bosh_vsphere_cpi 1.2479.0 → 1.2513.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/cloud/vsphere/agent_env.rb +88 -0
- data/lib/cloud/vsphere/client.rb +19 -0
- data/lib/cloud/vsphere/cloud.rb +24 -130
- data/lib/cloud/vsphere/file_provider.rb +43 -0
- data/lib/cloud/vsphere/retry_block.rb +16 -0
- data/lib/cloud/vsphere/version.rb +1 -1
- data/lib/cloud/vsphere/vm_creator.rb +6 -4
- data/lib/cloud/vsphere/vm_creator_builder.rb +3 -1
- metadata +11 -8
@@ -0,0 +1,88 @@
|
|
1
|
+
module VSphereCloud
|
2
|
+
class AgentEnv
|
3
|
+
include VimSdk
|
4
|
+
include RetryBlock
|
5
|
+
|
6
|
+
def initialize(client, file_provider)
|
7
|
+
@client = client
|
8
|
+
@file_provider = file_provider
|
9
|
+
end
|
10
|
+
|
11
|
+
def get_current_env(location)
|
12
|
+
contents = @file_provider.fetch_file(location[:datacenter], location[:datastore], "#{location[:vm]}/env.json")
|
13
|
+
contents ? JSON.load(contents) : nil
|
14
|
+
end
|
15
|
+
|
16
|
+
def set_env(vm, location, env)
|
17
|
+
env_json = JSON.dump(env)
|
18
|
+
|
19
|
+
connect_cdrom(vm, false)
|
20
|
+
@file_provider.upload_file(location[:datacenter], location[:datastore], "#{location[:vm]}/env.json", env_json)
|
21
|
+
@file_provider.upload_file(location[:datacenter], location[:datastore], "#{location[:vm]}/env.iso", generate_env_iso(env_json))
|
22
|
+
connect_cdrom(vm, true)
|
23
|
+
end
|
24
|
+
|
25
|
+
def configure_env_cdrom(datastore, devices, file_name)
|
26
|
+
backing_info = Vim::Vm::Device::VirtualCdrom::IsoBackingInfo.new
|
27
|
+
backing_info.datastore = datastore
|
28
|
+
backing_info.file_name = file_name
|
29
|
+
|
30
|
+
connect_info = Vim::Vm::Device::VirtualDevice::ConnectInfo.new
|
31
|
+
connect_info.allow_guest_control = false
|
32
|
+
connect_info.start_connected = true
|
33
|
+
connect_info.connected = true
|
34
|
+
|
35
|
+
cdrom = devices.find { |device| device.kind_of?(Vim::Vm::Device::VirtualCdrom) }
|
36
|
+
cdrom.connectable = connect_info
|
37
|
+
cdrom.backing = backing_info
|
38
|
+
|
39
|
+
create_edit_device_spec(cdrom)
|
40
|
+
end
|
41
|
+
|
42
|
+
private
|
43
|
+
|
44
|
+
def connect_cdrom(vm, connected = true)
|
45
|
+
devices = @client.get_property(vm, Vim::VirtualMachine, 'config.hardware.device', ensure_all: true)
|
46
|
+
cdrom = devices.find { |device| device.kind_of?(Vim::Vm::Device::VirtualCdrom) }
|
47
|
+
|
48
|
+
if cdrom.connectable.connected != connected
|
49
|
+
cdrom.connectable.connected = connected
|
50
|
+
config = Vim::Vm::ConfigSpec.new
|
51
|
+
config.device_change = [create_edit_device_spec(cdrom)]
|
52
|
+
@client.reconfig_vm(vm, config)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
def generate_env_iso(env)
|
57
|
+
Dir.mktmpdir do |path|
|
58
|
+
env_path = File.join(path, 'env')
|
59
|
+
iso_path = File.join(path, 'env.iso')
|
60
|
+
File.open(env_path, 'w') { |f| f.write(env) }
|
61
|
+
output = `#{genisoimage} -o #{iso_path} #{env_path} 2>&1`
|
62
|
+
raise "#{$?.exitstatus} -#{output}" if $?.exitstatus != 0
|
63
|
+
File.open(iso_path, 'r') { |f| f.read }
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
def which(programs)
|
68
|
+
ENV['PATH'].split(File::PATH_SEPARATOR).each do |path|
|
69
|
+
programs.each do |bin|
|
70
|
+
exe = File.join(path, bin)
|
71
|
+
return exe if File.exists?(exe)
|
72
|
+
end
|
73
|
+
end
|
74
|
+
programs.first
|
75
|
+
end
|
76
|
+
|
77
|
+
def genisoimage
|
78
|
+
@genisoimage ||= which(%w{genisoimage mkisofs})
|
79
|
+
end
|
80
|
+
|
81
|
+
def create_edit_device_spec(device)
|
82
|
+
device_config_spec = Vim::Vm::Device::VirtualDeviceSpec.new
|
83
|
+
device_config_spec.device = device
|
84
|
+
device_config_spec.operation = Vim::Vm::Device::VirtualDeviceSpec::Operation::EDIT
|
85
|
+
device_config_spec
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
data/lib/cloud/vsphere/client.rb
CHANGED
@@ -204,6 +204,25 @@ module VSphereCloud
|
|
204
204
|
tasks.each { |task| wait_for_task(task) }
|
205
205
|
end
|
206
206
|
|
207
|
+
def create_folder(name)
|
208
|
+
@service_content.root_folder.create_folder(name)
|
209
|
+
end
|
210
|
+
|
211
|
+
def move_into_folder(folder, objects)
|
212
|
+
task = folder.move_into(objects)
|
213
|
+
wait_for_task(task)
|
214
|
+
end
|
215
|
+
|
216
|
+
def move_into_root_folder(objects)
|
217
|
+
task = @service_content.root_folder.move_into(objects)
|
218
|
+
wait_for_task(task)
|
219
|
+
end
|
220
|
+
|
221
|
+
def delete_folder(folder)
|
222
|
+
task = folder.destroy
|
223
|
+
wait_for_task(task)
|
224
|
+
end
|
225
|
+
|
207
226
|
def find_by_inventory_path(path)
|
208
227
|
full_path = Array(path).join("/")
|
209
228
|
@service_content.search_index.find_by_inventory_path(full_path)
|
data/lib/cloud/vsphere/cloud.rb
CHANGED
@@ -2,8 +2,11 @@ require 'json'
|
|
2
2
|
require 'membrane'
|
3
3
|
require 'ruby_vim_sdk'
|
4
4
|
require 'cloud'
|
5
|
+
require 'cloud/vsphere/retry_block'
|
5
6
|
require 'cloud/vsphere/client'
|
6
7
|
require 'cloud/vsphere/config'
|
8
|
+
require 'cloud/vsphere/file_provider'
|
9
|
+
require 'cloud/vsphere/agent_env'
|
7
10
|
require 'cloud/vsphere/lease_obtainer'
|
8
11
|
require 'cloud/vsphere/lease_updater'
|
9
12
|
require 'cloud/vsphere/resources'
|
@@ -23,6 +26,7 @@ module VSphereCloud
|
|
23
26
|
|
24
27
|
class Cloud < Bosh::Cloud
|
25
28
|
include VimSdk
|
29
|
+
include RetryBlock
|
26
30
|
|
27
31
|
class TimeoutException < StandardError;
|
28
32
|
end
|
@@ -34,8 +38,9 @@ module VSphereCloud
|
|
34
38
|
|
35
39
|
@logger = config.logger
|
36
40
|
@client = config.client
|
37
|
-
@rest_client = config.rest_client
|
38
41
|
@resources = Resources.new(config)
|
42
|
+
@file_provider = FileProvider.new(config.rest_client, config.vcenter_host)
|
43
|
+
@agent_env = AgentEnv.new(client, @file_provider)
|
39
44
|
|
40
45
|
# Global lock
|
41
46
|
@lock = Mutex.new
|
@@ -167,24 +172,18 @@ module VSphereCloud
|
|
167
172
|
|
168
173
|
def create_vm(agent_id, stemcell, cloud_properties, networks, disk_locality = nil, environment = nil)
|
169
174
|
with_thread_name("create_vm(#{agent_id}, ...)") do
|
170
|
-
VmCreatorBuilder.new.build(
|
171
|
-
|
175
|
+
VmCreatorBuilder.new.build(
|
176
|
+
choose_placer(cloud_properties),
|
177
|
+
cloud_properties,
|
178
|
+
@client,
|
179
|
+
@logger,
|
180
|
+
self,
|
181
|
+
@agent_env,
|
182
|
+
@file_provider
|
183
|
+
).create(agent_id, stemcell, networks, disk_locality, environment)
|
172
184
|
end
|
173
185
|
end
|
174
186
|
|
175
|
-
def retry_block(num = 2)
|
176
|
-
result = nil
|
177
|
-
num.times do |i|
|
178
|
-
begin
|
179
|
-
result = yield
|
180
|
-
break
|
181
|
-
rescue RuntimeError
|
182
|
-
raise if i + 1 >= num
|
183
|
-
end
|
184
|
-
end
|
185
|
-
result
|
186
|
-
end
|
187
|
-
|
188
187
|
def delete_vm(vm_cid)
|
189
188
|
with_thread_name("delete_vm(#{vm_cid})") do
|
190
189
|
@logger.info("Deleting vm: #{vm_cid}")
|
@@ -357,14 +356,14 @@ module VSphereCloud
|
|
357
356
|
@client.reconfig_vm(vm, config)
|
358
357
|
|
359
358
|
location = get_vm_location(vm, datacenter: datacenter_name)
|
360
|
-
env =
|
359
|
+
env = @agent_env.get_current_env(location)
|
361
360
|
@logger.debug("Reading current agent env: #{env.pretty_inspect}")
|
362
361
|
|
363
362
|
devices = client.get_property(vm, Vim::VirtualMachine, 'config.hardware.device', ensure_all: true)
|
364
363
|
env['networks'] = generate_network_env(devices, networks, dvs_index)
|
365
364
|
|
366
365
|
@logger.debug("Updating agent env to: #{env.pretty_inspect}")
|
367
|
-
|
366
|
+
@agent_env.set_env(vm, location, env)
|
368
367
|
|
369
368
|
@logger.debug('Powering the VM back on')
|
370
369
|
client.power_on_vm(datacenter, vm)
|
@@ -414,7 +413,7 @@ module VSphereCloud
|
|
414
413
|
vm = get_vm_by_cid(vm_cid)
|
415
414
|
|
416
415
|
datacenter = client.find_parent(vm, Vim::Datacenter)
|
417
|
-
datacenter_name =
|
416
|
+
datacenter_name = config.datacenter_name
|
418
417
|
|
419
418
|
vm_properties = client.get_properties(vm, Vim::VirtualMachine, 'config.hardware.device', ensure_all: true)
|
420
419
|
host_info = get_vm_host_info(vm)
|
@@ -488,11 +487,11 @@ module VSphereCloud
|
|
488
487
|
fix_device_unit_numbers(devices, config.device_change)
|
489
488
|
|
490
489
|
location = get_vm_location(vm, datacenter: datacenter_name)
|
491
|
-
env =
|
490
|
+
env = @agent_env.get_current_env(location)
|
492
491
|
@logger.info("Reading current agent env: #{env.pretty_inspect}")
|
493
492
|
env['disks']['persistent'][disk.uuid] = attached_disk_config.device.unit_number.to_s
|
494
493
|
@logger.info("Updating agent env to: #{env.pretty_inspect}")
|
495
|
-
|
494
|
+
@agent_env.set_env(vm, location, env)
|
496
495
|
@logger.info('Attaching disk')
|
497
496
|
client.reconfig_vm(vm, config)
|
498
497
|
@logger.info('Finished attaching disk')
|
@@ -521,11 +520,11 @@ module VSphereCloud
|
|
521
520
|
config.device_change << create_delete_device_spec(virtual_disk)
|
522
521
|
|
523
522
|
location = get_vm_location(vm)
|
524
|
-
env =
|
523
|
+
env = @agent_env.get_current_env(location)
|
525
524
|
@logger.info("Reading current agent env: #{env.pretty_inspect}")
|
526
525
|
env['disks']['persistent'].delete(disk.uuid)
|
527
526
|
@logger.info("Updating agent env to: #{env.pretty_inspect}")
|
528
|
-
|
527
|
+
@agent_env.set_env(vm, location, env)
|
529
528
|
@logger.info('Detaching disk')
|
530
529
|
client.reconfig_vm(vm, config)
|
531
530
|
|
@@ -568,7 +567,7 @@ module VSphereCloud
|
|
568
567
|
if disk
|
569
568
|
if disk.path
|
570
569
|
datacenter = client.find_by_inventory_path(disk.datacenter)
|
571
|
-
raise Bosh::Clouds::DiskNotFound.new(true), "disk #{disk_cid} not found" if datacenter.nil?
|
570
|
+
raise Bosh::Clouds::DiskNotFound.new(true), "disk #{disk_cid} not found" if datacenter.nil?
|
572
571
|
|
573
572
|
client.delete_disk(datacenter, disk.path)
|
574
573
|
end
|
@@ -704,8 +703,7 @@ module VSphereCloud
|
|
704
703
|
vm_name = options[:vm]
|
705
704
|
|
706
705
|
unless datacenter_name
|
707
|
-
|
708
|
-
datacenter_name = client.get_property(datacenter, Vim::Datacenter, 'name')
|
706
|
+
datacenter_name = config.datacenter_name
|
709
707
|
end
|
710
708
|
|
711
709
|
if vm_name.nil? || datastore_name.nil?
|
@@ -739,103 +737,6 @@ module VSphereCloud
|
|
739
737
|
datastore
|
740
738
|
end
|
741
739
|
|
742
|
-
def get_current_agent_env(location)
|
743
|
-
contents = fetch_file(location[:datacenter], location[:datastore], "#{location[:vm]}/env.json")
|
744
|
-
contents ? JSON.load(contents) : nil
|
745
|
-
end
|
746
|
-
|
747
|
-
def set_agent_env(vm, location, env)
|
748
|
-
env_json = JSON.dump(env)
|
749
|
-
|
750
|
-
connect_cdrom(vm, false)
|
751
|
-
upload_file(location[:datacenter], location[:datastore], "#{location[:vm]}/env.json", env_json)
|
752
|
-
upload_file(location[:datacenter], location[:datastore], "#{location[:vm]}/env.iso", generate_env_iso(env_json))
|
753
|
-
connect_cdrom(vm, true)
|
754
|
-
end
|
755
|
-
|
756
|
-
def connect_cdrom(vm, connected = true)
|
757
|
-
devices = client.get_property(vm, Vim::VirtualMachine, 'config.hardware.device', ensure_all: true)
|
758
|
-
cdrom = devices.find { |device| device.kind_of?(Vim::Vm::Device::VirtualCdrom) }
|
759
|
-
|
760
|
-
if cdrom.connectable.connected != connected
|
761
|
-
cdrom.connectable.connected = connected
|
762
|
-
config = Vim::Vm::ConfigSpec.new
|
763
|
-
config.device_change = [create_edit_device_spec(cdrom)]
|
764
|
-
client.reconfig_vm(vm, config)
|
765
|
-
end
|
766
|
-
end
|
767
|
-
|
768
|
-
def configure_env_cdrom(datastore, devices, file_name)
|
769
|
-
backing_info = Vim::Vm::Device::VirtualCdrom::IsoBackingInfo.new
|
770
|
-
backing_info.datastore = datastore
|
771
|
-
backing_info.file_name = file_name
|
772
|
-
|
773
|
-
connect_info = Vim::Vm::Device::VirtualDevice::ConnectInfo.new
|
774
|
-
connect_info.allow_guest_control = false
|
775
|
-
connect_info.start_connected = true
|
776
|
-
connect_info.connected = true
|
777
|
-
|
778
|
-
cdrom = devices.find { |device| device.kind_of?(Vim::Vm::Device::VirtualCdrom) }
|
779
|
-
cdrom.connectable = connect_info
|
780
|
-
cdrom.backing = backing_info
|
781
|
-
|
782
|
-
create_edit_device_spec(cdrom)
|
783
|
-
end
|
784
|
-
|
785
|
-
def which(programs)
|
786
|
-
ENV['PATH'].split(File::PATH_SEPARATOR).each do |path|
|
787
|
-
programs.each do |bin|
|
788
|
-
exe = File.join(path, bin)
|
789
|
-
return exe if File.exists?(exe)
|
790
|
-
end
|
791
|
-
end
|
792
|
-
programs.first
|
793
|
-
end
|
794
|
-
|
795
|
-
def genisoimage
|
796
|
-
@genisoimage ||= which(%w{genisoimage mkisofs})
|
797
|
-
end
|
798
|
-
|
799
|
-
def generate_env_iso(env)
|
800
|
-
Dir.mktmpdir do |path|
|
801
|
-
env_path = File.join(path, 'env')
|
802
|
-
iso_path = File.join(path, 'env.iso')
|
803
|
-
File.open(env_path, 'w') { |f| f.write(env) }
|
804
|
-
output = `#{genisoimage} -o #{iso_path} #{env_path} 2>&1`
|
805
|
-
raise "#{$?.exitstatus} -#{output}" if $?.exitstatus != 0
|
806
|
-
File.open(iso_path, 'r') { |f| f.read }
|
807
|
-
end
|
808
|
-
end
|
809
|
-
|
810
|
-
def fetch_file(datacenter_name, datastore_name, path)
|
811
|
-
retry_block do
|
812
|
-
url =
|
813
|
-
"https://#{config.vcenter_host}/folder/#{path}?dcPath=#{URI.escape(datacenter_name)}&dsName=#{URI.escape(datastore_name)}"
|
814
|
-
|
815
|
-
response = @rest_client.get(url)
|
816
|
-
|
817
|
-
if response.code < 400
|
818
|
-
response.body
|
819
|
-
elsif response.code == 404
|
820
|
-
nil
|
821
|
-
else
|
822
|
-
raise "Could not fetch file: #{url}, status code: #{response.code}"
|
823
|
-
end
|
824
|
-
end
|
825
|
-
end
|
826
|
-
|
827
|
-
def upload_file(datacenter_name, datastore_name, path, contents)
|
828
|
-
retry_block do
|
829
|
-
url =
|
830
|
-
"https://#{config.vcenter_host}/folder/#{path}?dcPath=#{URI.escape(datacenter_name)}&dsName=#{URI.escape(datastore_name)}"
|
831
|
-
response = @rest_client.put(url,
|
832
|
-
contents,
|
833
|
-
{ 'Content-Type' => 'application/octet-stream', 'Content-Length' => contents.length })
|
834
|
-
|
835
|
-
raise "Could not upload file: #{url}, status code: #{response.code}" unless response.code < 400
|
836
|
-
end
|
837
|
-
end
|
838
|
-
|
839
740
|
def clone_vm(vm, name, folder, resource_pool, options={})
|
840
741
|
relocation_spec = Vim::Vm::RelocateSpec.new
|
841
742
|
relocation_spec.datastore = options[:datastore] if options[:datastore]
|
@@ -929,13 +830,6 @@ module VSphereCloud
|
|
929
830
|
device_config_spec
|
930
831
|
end
|
931
832
|
|
932
|
-
def create_edit_device_spec(device)
|
933
|
-
device_config_spec = Vim::Vm::Device::VirtualDeviceSpec.new
|
934
|
-
device_config_spec.device = device
|
935
|
-
device_config_spec.operation = Vim::Vm::Device::VirtualDeviceSpec::Operation::EDIT
|
936
|
-
device_config_spec
|
937
|
-
end
|
938
|
-
|
939
833
|
def fix_device_unit_numbers(devices, device_changes)
|
940
834
|
controllers_available_unit_numbers = Hash.new { |h,k| h[k] = (0..15).to_a }
|
941
835
|
devices.each do |device|
|
@@ -0,0 +1,43 @@
|
|
1
|
+
module VSphereCloud
|
2
|
+
class FileProvider
|
3
|
+
include RetryBlock
|
4
|
+
|
5
|
+
def initialize(rest_client, vcenter_host)
|
6
|
+
@vcenter_host = vcenter_host
|
7
|
+
@rest_client = rest_client
|
8
|
+
end
|
9
|
+
|
10
|
+
def fetch_file(datacenter_name, datastore_name, path)
|
11
|
+
retry_block do
|
12
|
+
url ="https://#{@vcenter_host}/folder/#{path}?dcPath=#{URI.escape(datacenter_name)}" +
|
13
|
+
"&dsName=#{URI.escape(datastore_name)}"
|
14
|
+
|
15
|
+
response = @rest_client.get(url)
|
16
|
+
|
17
|
+
if response.code < 400
|
18
|
+
response.body
|
19
|
+
elsif response.code == 404
|
20
|
+
nil
|
21
|
+
else
|
22
|
+
raise "Could not fetch file: #{url}, status code: #{response.code}"
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def upload_file(datacenter_name, datastore_name, path, contents)
|
28
|
+
retry_block do
|
29
|
+
url = "https://#{@vcenter_host}/folder/#{path}?dcPath=#{URI.escape(datacenter_name)}" +
|
30
|
+
"&dsName=#{URI.escape(datastore_name)}"
|
31
|
+
|
32
|
+
response = @rest_client.put(
|
33
|
+
url,
|
34
|
+
contents,
|
35
|
+
{ 'Content-Type' => 'application/octet-stream', 'Content-Length' => contents.length })
|
36
|
+
|
37
|
+
unless response.code < 400
|
38
|
+
raise "Could not upload file: #{url}, status code: #{response.code}"
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -2,7 +2,7 @@ require 'ruby_vim_sdk'
|
|
2
2
|
|
3
3
|
module VSphereCloud
|
4
4
|
class VmCreator
|
5
|
-
def initialize(memory, disk, cpu, placer, client, logger, cpi)
|
5
|
+
def initialize(memory, disk, cpu, placer, client, logger, cpi, agent_env, file_provider)
|
6
6
|
@placer = placer
|
7
7
|
@client = client
|
8
8
|
@logger = logger
|
@@ -10,6 +10,8 @@ module VSphereCloud
|
|
10
10
|
@memory = memory
|
11
11
|
@disk = disk
|
12
12
|
@cpu = cpu
|
13
|
+
@agent_env = agent_env
|
14
|
+
@file_provider = file_provider
|
13
15
|
|
14
16
|
@logger.debug("VM creator initialized with memory: #{@memory}, disk: #{@disk}, cpu: #{@cpu}, placer: #{@placer}")
|
15
17
|
end
|
@@ -80,7 +82,7 @@ module VSphereCloud
|
|
80
82
|
vm = @client.wait_for_task(task)
|
81
83
|
|
82
84
|
begin
|
83
|
-
@
|
85
|
+
@file_provider.upload_file(cluster.datacenter.name, datastore.name, "#{name}/env.iso", '')
|
84
86
|
|
85
87
|
vm_properties = @client.get_properties(vm, VimSdk::Vim::VirtualMachine, ['config.hardware.device'], ensure_all: true)
|
86
88
|
devices = vm_properties['config.hardware.device']
|
@@ -89,7 +91,7 @@ module VSphereCloud
|
|
89
91
|
config = VimSdk::Vim::Vm::ConfigSpec.new
|
90
92
|
config.device_change = []
|
91
93
|
file_name = "[#{datastore.name}] #{name}/env.iso"
|
92
|
-
cdrom_change = @
|
94
|
+
cdrom_change = @agent_env.configure_env_cdrom(datastore.mob, devices, file_name)
|
93
95
|
config.device_change << cdrom_change
|
94
96
|
@client.reconfig_vm(vm, config)
|
95
97
|
|
@@ -101,7 +103,7 @@ module VSphereCloud
|
|
101
103
|
|
102
104
|
location =
|
103
105
|
@cpi.get_vm_location(vm, datacenter: cluster.datacenter.name, datastore: datastore.name, vm: name)
|
104
|
-
@
|
106
|
+
@agent_env.set_env(vm, location, env)
|
105
107
|
|
106
108
|
@logger.info("Powering on VM: #{vm} (#{name})")
|
107
109
|
@client.power_on_vm(cluster.datacenter.mob, vm)
|
@@ -2,7 +2,7 @@ require 'cloud/vsphere/vm_creator'
|
|
2
2
|
|
3
3
|
module VSphereCloud
|
4
4
|
class VmCreatorBuilder
|
5
|
-
def build(resources, cloud_properties, client, logger, cpi)
|
5
|
+
def build(resources, cloud_properties, client, logger, cpi, agent_env, file_provider)
|
6
6
|
VmCreator.new(
|
7
7
|
cloud_properties.fetch('ram'),
|
8
8
|
cloud_properties.fetch('disk'),
|
@@ -11,6 +11,8 @@ module VSphereCloud
|
|
11
11
|
client,
|
12
12
|
logger,
|
13
13
|
cpi,
|
14
|
+
agent_env,
|
15
|
+
file_provider,
|
14
16
|
)
|
15
17
|
end
|
16
18
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bosh_vsphere_cpi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2513.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-04-
|
12
|
+
date: 2014-04-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bosh_common
|
@@ -18,7 +18,7 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 1.
|
21
|
+
version: 1.2513.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ~>
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 1.
|
29
|
+
version: 1.2513.0
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: bosh_cpi
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
@@ -34,7 +34,7 @@ dependencies:
|
|
34
34
|
requirements:
|
35
35
|
- - ~>
|
36
36
|
- !ruby/object:Gem::Version
|
37
|
-
version: 1.
|
37
|
+
version: 1.2513.0
|
38
38
|
type: :runtime
|
39
39
|
prerelease: false
|
40
40
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -42,7 +42,7 @@ dependencies:
|
|
42
42
|
requirements:
|
43
43
|
- - ~>
|
44
44
|
- !ruby/object:Gem::Version
|
45
|
-
version: 1.
|
45
|
+
version: 1.2513.0
|
46
46
|
- !ruby/object:Gem::Dependency
|
47
47
|
name: membrane
|
48
48
|
requirement: !ruby/object:Gem::Requirement
|
@@ -93,7 +93,7 @@ dependencies:
|
|
93
93
|
version: '0'
|
94
94
|
description: ! 'BOSH VSphere CPI
|
95
95
|
|
96
|
-
|
96
|
+
f90a96'
|
97
97
|
email: support@cloudfoundry.com
|
98
98
|
executables:
|
99
99
|
- vsphere_cpi_console
|
@@ -103,10 +103,12 @@ files:
|
|
103
103
|
- db/migrations/20120123235022_initial.rb
|
104
104
|
- db/migrations/20121204174707_add_uuid_to_disks.rb
|
105
105
|
- lib/cloud/vsphere.rb
|
106
|
+
- lib/cloud/vsphere/agent_env.rb
|
106
107
|
- lib/cloud/vsphere/client.rb
|
107
108
|
- lib/cloud/vsphere/cloud.rb
|
108
109
|
- lib/cloud/vsphere/cluster_config.rb
|
109
110
|
- lib/cloud/vsphere/config.rb
|
111
|
+
- lib/cloud/vsphere/file_provider.rb
|
110
112
|
- lib/cloud/vsphere/fixed_cluster_placer.rb
|
111
113
|
- lib/cloud/vsphere/lease_obtainer.rb
|
112
114
|
- lib/cloud/vsphere/lease_updater.rb
|
@@ -120,6 +122,7 @@ files:
|
|
120
122
|
- lib/cloud/vsphere/resources/resource_pool.rb
|
121
123
|
- lib/cloud/vsphere/resources/scorer.rb
|
122
124
|
- lib/cloud/vsphere/resources/util.rb
|
125
|
+
- lib/cloud/vsphere/retry_block.rb
|
123
126
|
- lib/cloud/vsphere/version.rb
|
124
127
|
- lib/cloud/vsphere/vm_creator.rb
|
125
128
|
- lib/cloud/vsphere/vm_creator_builder.rb
|
@@ -172,7 +175,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
172
175
|
version: '0'
|
173
176
|
segments:
|
174
177
|
- 0
|
175
|
-
hash:
|
178
|
+
hash: 3707675564135352565
|
176
179
|
requirements: []
|
177
180
|
rubyforge_project:
|
178
181
|
rubygems_version: 1.8.23
|