vmpooler-provider-vsphere 2.1.0 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/vmpooler/providers/vsphere.rb +34 -3
- data/lib/vmpooler-provider-vsphere/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa975e899d87bb13db4a666994ba9aab6795b90f77e4fa82fc1ab2f593ff9df4
|
4
|
+
data.tar.gz: b71765cf7c70a82ab6a170661c00783f5c140cd72e2d42587e37431a902479c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c3b57116ad877e205f601ee52b239b3ab7bec57da02ee29272b54dee8b3604bbe653165279f37182337b637b0d5746145fe7dba27a20f7f0f5328e9b986c8f6
|
7
|
+
data.tar.gz: 4943b690045a60941b7b9cdf760fb702cb0b78e44c2e4cd3ca2b984d6a568c83b872b97abe2b0162c6518b7c34dd92a58dbd28d4afe629c5df7f50d49b48d32d
|
@@ -51,6 +51,11 @@ module Vmpooler
|
|
51
51
|
'vsphere'
|
52
52
|
end
|
53
53
|
|
54
|
+
def domain(pool_name)
|
55
|
+
dns_plugin_name = pool_config(pool_name)['dns_plugin']
|
56
|
+
dns_config(dns_plugin_name)
|
57
|
+
end
|
58
|
+
|
54
59
|
def folder_configured?(folder_title, base_folder, configured_folders, allowlist)
|
55
60
|
return true if allowlist&.include?(folder_title)
|
56
61
|
return false unless configured_folders.keys.include?(folder_title)
|
@@ -387,6 +392,16 @@ module Vmpooler
|
|
387
392
|
vm_hash
|
388
393
|
end
|
389
394
|
|
395
|
+
# The inner method requires vmware tools running in the guest os
|
396
|
+
def get_vm_ip_address(vm_name, pool_name)
|
397
|
+
@connection_pool.with_metrics do |pool_object|
|
398
|
+
connection = ensured_vsphere_connection(pool_object)
|
399
|
+
vm_object = find_vm(pool_name, vm_name, connection)
|
400
|
+
vm_hash = generate_vm_hash(vm_object, pool_name)
|
401
|
+
return vm_hash['ip']
|
402
|
+
end
|
403
|
+
end
|
404
|
+
|
390
405
|
def create_config_spec(vm_name, template_name, extra_config)
|
391
406
|
RbVmomi::VIM.VirtualMachineConfigSpec(
|
392
407
|
annotation: JSON.pretty_generate(
|
@@ -540,9 +555,10 @@ module Vmpooler
|
|
540
555
|
true
|
541
556
|
end
|
542
557
|
|
543
|
-
def vm_ready?(
|
558
|
+
def vm_ready?(pool_name, vm_name)
|
544
559
|
begin
|
545
|
-
|
560
|
+
domain = domain(pool_name)
|
561
|
+
open_socket(vm_name, domain)
|
546
562
|
rescue StandardError => _e
|
547
563
|
return false
|
548
564
|
end
|
@@ -582,13 +598,28 @@ module Vmpooler
|
|
582
598
|
boottime = vm_object.runtime.bootTime if vm_object.runtime&.bootTime
|
583
599
|
powerstate = vm_object.runtime.powerState if vm_object.runtime&.powerState
|
584
600
|
|
601
|
+
ip_maxloop = 60
|
602
|
+
ip_loop_delay = 1
|
603
|
+
ip_loop_count = 1
|
604
|
+
ip = nil
|
605
|
+
while ip.nil?
|
606
|
+
sleep(ip_loop_delay)
|
607
|
+
ip = vm_object.guest_ip
|
608
|
+
unless ip_maxloop == 0
|
609
|
+
break if ip_loop_count >= ip_maxloop
|
610
|
+
|
611
|
+
ip_loop_count += 1
|
612
|
+
end
|
613
|
+
end
|
614
|
+
|
585
615
|
{
|
586
616
|
'name' => vm_object.name,
|
587
617
|
'hostname' => hostname,
|
588
618
|
'template' => pool_configuration['template'],
|
589
619
|
'poolname' => pool_name,
|
590
620
|
'boottime' => boottime,
|
591
|
-
'powerstate' => powerstate
|
621
|
+
'powerstate' => powerstate,
|
622
|
+
'ip' => ip
|
592
623
|
}
|
593
624
|
end
|
594
625
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vmpooler-provider-vsphere
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Puppet
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-05-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -35,7 +35,7 @@ dependencies:
|
|
35
35
|
requirements:
|
36
36
|
- - "~>"
|
37
37
|
- !ruby/object:Gem::Version
|
38
|
-
version: '
|
38
|
+
version: '3.0'
|
39
39
|
name: vmpooler
|
40
40
|
prerelease: false
|
41
41
|
type: :runtime
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
requirements:
|
44
44
|
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: '
|
46
|
+
version: '3.0'
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
requirement: !ruby/object:Gem::Requirement
|
49
49
|
requirements:
|