bosh_vsphere_cpi 1.2719.0 → 1.2732.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8188f0675089aad281d4fb9992ec91a3beb83e4a
|
4
|
+
data.tar.gz: 626c483bb8e09007bc5e96e5b5e36e3750c75ef6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a96c8f1900d94d85be0ea8ed851bd34a1b2e0d3f5537d90557abbf2e134e79e76c33bed2a2644b03710101d8e0c75e5a2abbe02372e00891e634de88b3dd5ddc
|
7
|
+
data.tar.gz: 58c627aca4372244009a3c793221d86d7b102ad72ed5966b61ae6537a1abd1126f82610cd5759023ea3178d453276234d9f8918a8bb80d3e946a42b34fd7f1e8
|
data/lib/cloud/vsphere/cloud.rb
CHANGED
@@ -14,6 +14,7 @@ require 'cloud/vsphere/resources/cluster'
|
|
14
14
|
require 'cloud/vsphere/resources/datacenter'
|
15
15
|
require 'cloud/vsphere/resources/datastore'
|
16
16
|
require 'cloud/vsphere/resources/folder'
|
17
|
+
require 'cloud/vsphere/resources/multi_tenant_folder'
|
17
18
|
require 'cloud/vsphere/resources/resource_pool'
|
18
19
|
require 'cloud/vsphere/resources/scorer'
|
19
20
|
require 'cloud/vsphere/resources/util'
|
@@ -947,21 +948,16 @@ module VSphereCloud
|
|
947
948
|
|
948
949
|
def get_vms
|
949
950
|
subfolders = []
|
950
|
-
vms = []
|
951
951
|
with_thread_name("get_vms") do
|
952
952
|
@resources.datacenters.each_value do |datacenter|
|
953
|
-
@logger.info("Looking for VMs in: #{datacenter.name} - #{datacenter.
|
954
|
-
subfolders += datacenter.
|
955
|
-
@logger.info("Looking for Stemcells in: #{datacenter.name} - #{datacenter.
|
956
|
-
subfolders += datacenter.
|
953
|
+
@logger.info("Looking for VMs in: #{datacenter.name} - #{datacenter.master_vm_folder.name}")
|
954
|
+
subfolders += datacenter.master_vm_folder.mob.child_entity
|
955
|
+
@logger.info("Looking for Stemcells in: #{datacenter.name} - #{datacenter.master_template_folder.name}")
|
956
|
+
subfolders += datacenter.master_template_folder.mob.child_entity
|
957
957
|
end
|
958
958
|
end
|
959
959
|
|
960
|
-
subfolders.
|
961
|
-
vms += folder.child_entity
|
962
|
-
end
|
963
|
-
|
964
|
-
vms
|
960
|
+
subfolders.map { |folder| folder.child_entity }.flatten
|
965
961
|
end
|
966
962
|
|
967
963
|
def ping
|
@@ -16,10 +16,26 @@ module VSphereCloud
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def vm_folder
|
19
|
+
if @config.datacenter_use_sub_folder
|
20
|
+
MultiTenantFolder.new(@config.datacenter_vm_folder, Bosh::Clouds::Config.uuid, @config)
|
21
|
+
else
|
22
|
+
master_vm_folder
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def master_vm_folder
|
19
27
|
Folder.new(@config.datacenter_vm_folder, @config)
|
20
28
|
end
|
21
29
|
|
22
30
|
def template_folder
|
31
|
+
if @config.datacenter_use_sub_folder
|
32
|
+
MultiTenantFolder.new(@config.datacenter_template_folder, Bosh::Clouds::Config.uuid, @config)
|
33
|
+
else
|
34
|
+
master_template_folder
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def master_template_folder
|
23
39
|
Folder.new(@config.datacenter_template_folder, @config)
|
24
40
|
end
|
25
41
|
|
@@ -1,54 +1,22 @@
|
|
1
1
|
module VSphereCloud
|
2
|
-
|
3
2
|
class Resources
|
4
|
-
|
5
3
|
class Folder
|
6
|
-
attr_reader :mob
|
7
|
-
attr_reader :name
|
4
|
+
attr_reader :mob, :name
|
8
5
|
|
9
6
|
def initialize(name, config)
|
10
7
|
@name = name
|
11
8
|
@config = config
|
12
9
|
|
13
|
-
|
10
|
+
find_folder
|
14
11
|
end
|
15
12
|
|
16
13
|
private
|
17
14
|
|
18
|
-
def find_or_create_folder
|
19
|
-
folder = find_folder
|
20
|
-
|
21
|
-
if @config.datacenter_use_sub_folder
|
22
|
-
@name, @mob = find_or_create_sub_folder(folder)
|
23
|
-
else
|
24
|
-
@mob = folder
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
15
|
def find_folder
|
29
16
|
folder = @config.client.find_by_inventory_path([@config.datacenter_name, 'vm', @name])
|
30
17
|
raise "Missing folder: #{@name}" if folder.nil?
|
31
|
-
folder
|
18
|
+
@mob = folder
|
32
19
|
end
|
33
|
-
|
34
|
-
def find_or_create_sub_folder(folder)
|
35
|
-
parent_folder = folder
|
36
|
-
uuid = Bosh::Clouds::Config.uuid
|
37
|
-
|
38
|
-
sub_folder_name = [@name, uuid]
|
39
|
-
name_join = sub_folder_name.join("/")
|
40
|
-
|
41
|
-
@config.logger.debug("Search for folder #{name_join}")
|
42
|
-
sub_folder = @config.client.find_by_inventory_path([@config.datacenter_name, 'vm', sub_folder_name])
|
43
|
-
if sub_folder.nil?
|
44
|
-
@config.logger.debug("Creating folder #{name_join}")
|
45
|
-
sub_folder = parent_folder.create_folder(uuid)
|
46
|
-
end
|
47
|
-
@config.logger.debug("Found folder #{name_join}: #{sub_folder}")
|
48
|
-
|
49
|
-
[sub_folder_name, sub_folder]
|
50
|
-
end
|
51
|
-
|
52
20
|
end
|
53
21
|
end
|
54
22
|
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
module VSphereCloud
|
2
|
+
class Resources
|
3
|
+
class MultiTenantFolder
|
4
|
+
attr_reader :mob, :name
|
5
|
+
|
6
|
+
def initialize(parent_folder_name, sub_folder_name, config)
|
7
|
+
@parent_folder_name = parent_folder_name
|
8
|
+
@sub_folder_name = sub_folder_name
|
9
|
+
@name = [parent_folder_name, sub_folder_name]
|
10
|
+
@config = config
|
11
|
+
|
12
|
+
find_or_create_sub_folder
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
def find_or_create_sub_folder
|
18
|
+
parent_folder = find_parent_folder
|
19
|
+
name_join = @name.join("/")
|
20
|
+
|
21
|
+
@config.logger.debug("Attempting to create folder #{name_join}")
|
22
|
+
|
23
|
+
begin
|
24
|
+
sub_folder = parent_folder.create_folder(@sub_folder_name)
|
25
|
+
@config.logger.debug("Created folder #{name_join}")
|
26
|
+
rescue VimSdk::SoapError => e
|
27
|
+
raise e unless VimSdk::Vim::Fault::DuplicateName === e.fault
|
28
|
+
sub_folder = @config.client.find_by_inventory_path([@config.datacenter_name, 'vm', @name])
|
29
|
+
@config.logger.debug("Folder #{name_join} already exists")
|
30
|
+
end
|
31
|
+
|
32
|
+
@mob = sub_folder
|
33
|
+
end
|
34
|
+
|
35
|
+
def find_parent_folder
|
36
|
+
folder = @config.client.find_by_inventory_path([@config.datacenter_name, 'vm', @parent_folder_name])
|
37
|
+
raise "Missing folder: #{@parent_folder_name}" if folder.nil?
|
38
|
+
folder
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.2732.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-09-
|
11
|
+
date: 2014-09-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bosh_common
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.
|
19
|
+
version: 1.2732.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.
|
26
|
+
version: 1.2732.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bosh_cpi
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.
|
33
|
+
version: 1.2732.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.2732.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: membrane
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -152,7 +152,7 @@ dependencies:
|
|
152
152
|
version: 0.7.1
|
153
153
|
description: |-
|
154
154
|
BOSH VSphere CPI
|
155
|
-
|
155
|
+
f6dedd
|
156
156
|
email: support@cloudfoundry.com
|
157
157
|
executables:
|
158
158
|
- vsphere_cpi
|
@@ -185,6 +185,7 @@ files:
|
|
185
185
|
- lib/cloud/vsphere/resources/datacenter.rb
|
186
186
|
- lib/cloud/vsphere/resources/datastore.rb
|
187
187
|
- lib/cloud/vsphere/resources/folder.rb
|
188
|
+
- lib/cloud/vsphere/resources/multi_tenant_folder.rb
|
188
189
|
- lib/cloud/vsphere/resources/resource_pool.rb
|
189
190
|
- lib/cloud/vsphere/resources/scorer.rb
|
190
191
|
- lib/cloud/vsphere/resources/util.rb
|