vmpooler 0.16.0 → 0.18.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/api/helpers.rb +6 -4
- data/lib/vmpooler/pool_manager.rb +6 -10
- data/lib/vmpooler/providers/vsphere.rb +30 -11
- data/lib/vmpooler/version.rb +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 25f8f02e82db016ae0294993ad97c205d9560fce8fa12358022114866e92bf08
|
4
|
+
data.tar.gz: c9f2c79541bd7f04084608c000f09dce9b7b2db4a4d983c473207a1e1f001374
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5366548250b651add0e834b094a8397556ee8912620dd6d334de5131473a0dafa420e4df43a6f805455df5de062bc00ad36eb2991aa80f2afd039a2b9a0eb6ba
|
7
|
+
data.tar.gz: 2e2cd9e4cfd83152221c4c96defdc784a4332fee4c36349615b7d21697d622cef89be8bab52ce48c2acc5c8dd5216bc051cc3c28097747bd74f841568aa6232b
|
data/lib/vmpooler/api/helpers.rb
CHANGED
@@ -114,11 +114,13 @@ module Vmpooler
|
|
114
114
|
end
|
115
115
|
|
116
116
|
def export_tags(backend, hostname, tags)
|
117
|
-
|
118
|
-
|
117
|
+
backend.pipelined do
|
118
|
+
tags.each_pair do |tag, value|
|
119
|
+
next if value.nil? or value.empty?
|
119
120
|
|
120
|
-
|
121
|
-
|
121
|
+
backend.hset('vmpooler__vm__' + hostname, 'tag:' + tag, value)
|
122
|
+
backend.hset('vmpooler__tag__' + Date.today.to_s, hostname + ':' + tag, value)
|
123
|
+
end
|
122
124
|
end
|
123
125
|
end
|
124
126
|
|
@@ -289,19 +289,15 @@ module Vmpooler
|
|
289
289
|
move_vm_queue(pool, vm, 'running', 'completed', redis, "reached end of TTL after #{ttl} hours")
|
290
290
|
throw :stop_checking
|
291
291
|
end
|
292
|
+
else
|
293
|
+
move_vm_queue(pool, vm, 'running', 'completed', redis, 'is listed as running, but has no checkouttime data. Removing from running')
|
292
294
|
end
|
293
295
|
|
294
|
-
if provider.vm_ready?(pool, vm)
|
295
|
-
throw :stop_checking
|
296
|
-
else
|
297
|
-
host = provider.get_vm(pool, vm)
|
296
|
+
throw :stop_checking if provider.vm_ready?(pool, vm)
|
298
297
|
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
move_vm_queue(pool, vm, 'running', 'completed', redis, 'is no longer in inventory, removing from running')
|
303
|
-
end
|
304
|
-
end
|
298
|
+
throw :stop_checking if provider.get_vm(pool, vm)
|
299
|
+
|
300
|
+
move_vm_queue(pool, vm, 'running', 'completed', redis, 'is no longer in inventory, removing from running')
|
305
301
|
end
|
306
302
|
end
|
307
303
|
end
|
@@ -306,19 +306,26 @@ module Vmpooler
|
|
306
306
|
|
307
307
|
template_vm_object = find_template_vm(pool, connection)
|
308
308
|
|
309
|
+
extra_config = [
|
310
|
+
{ key: 'guestinfo.hostname', value: new_vmname }
|
311
|
+
]
|
312
|
+
|
313
|
+
if pool.key?('snapshot_mainMem_ioBlockPages')
|
314
|
+
ioblockpages = pool['snapshot_mainMem_ioBlockPages']
|
315
|
+
extra_config.push(
|
316
|
+
{ key: 'mainMem.ioBlockPages', value: ioblockpages }
|
317
|
+
)
|
318
|
+
end
|
319
|
+
if pool.key?('snapshot_mainMem_iowait')
|
320
|
+
iowait = pool['snapshot_mainMem_iowait']
|
321
|
+
extra_config.push(
|
322
|
+
{ key: 'mainMem.iowait', value: iowait }
|
323
|
+
)
|
324
|
+
end
|
325
|
+
|
309
326
|
# Annotate with creation time, origin template, etc.
|
310
327
|
# Add extraconfig options that can be queried by vmtools
|
311
|
-
config_spec =
|
312
|
-
annotation: JSON.pretty_generate(
|
313
|
-
name: new_vmname,
|
314
|
-
created_by: provider_config['username'],
|
315
|
-
base_template: template_path,
|
316
|
-
creation_timestamp: Time.now.utc
|
317
|
-
),
|
318
|
-
extraConfig: [
|
319
|
-
{ key: 'guestinfo.hostname', value: new_vmname }
|
320
|
-
]
|
321
|
-
)
|
328
|
+
config_spec = create_config_spec(new_vmname, template_path, extra_config)
|
322
329
|
|
323
330
|
# Check if alternate network configuration is specified and add configuration
|
324
331
|
if pool.key?('network')
|
@@ -358,6 +365,18 @@ module Vmpooler
|
|
358
365
|
vm_hash
|
359
366
|
end
|
360
367
|
|
368
|
+
def create_config_spec(vm_name, template_name, extra_config)
|
369
|
+
RbVmomi::VIM.VirtualMachineConfigSpec(
|
370
|
+
annotation: JSON.pretty_generate(
|
371
|
+
name: vm_name,
|
372
|
+
created_by: provider_config['username'],
|
373
|
+
base_template: template_name,
|
374
|
+
creation_timestamp: Time.now.utc
|
375
|
+
),
|
376
|
+
extraConfig: extra_config
|
377
|
+
)
|
378
|
+
end
|
379
|
+
|
361
380
|
def create_relocate_spec(target_datastore, target_datacenter_name, pool_name, connection)
|
362
381
|
pool = pool_config(pool_name)
|
363
382
|
target_cluster_name = get_target_cluster_from_config(pool_name)
|
data/lib/vmpooler/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vmpooler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.18.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Puppet
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-10-
|
11
|
+
date: 2020-10-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -128,14 +128,14 @@ dependencies:
|
|
128
128
|
requirements:
|
129
129
|
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: 0.7.
|
131
|
+
version: 0.7.1
|
132
132
|
type: :runtime
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: 0.7.
|
138
|
+
version: 0.7.1
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: opentelemetry-resource_detectors
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
@@ -384,16 +384,16 @@ dependencies:
|
|
384
384
|
name: rubocop
|
385
385
|
requirement: !ruby/object:Gem::Requirement
|
386
386
|
requirements:
|
387
|
-
- - "
|
387
|
+
- - "<"
|
388
388
|
- !ruby/object:Gem::Version
|
389
|
-
version: '0'
|
389
|
+
version: '1.0'
|
390
390
|
type: :development
|
391
391
|
prerelease: false
|
392
392
|
version_requirements: !ruby/object:Gem::Requirement
|
393
393
|
requirements:
|
394
|
-
- - "
|
394
|
+
- - "<"
|
395
395
|
- !ruby/object:Gem::Version
|
396
|
-
version: '0'
|
396
|
+
version: '1.0'
|
397
397
|
- !ruby/object:Gem::Dependency
|
398
398
|
name: simplecov
|
399
399
|
requirement: !ruby/object:Gem::Requirement
|