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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6b7f388dd31646303d099ae2d96085531bf9b3c024b90334d0fc2d22fed5233e
4
- data.tar.gz: 058e336a33e6bad6bcfa8c60df21b94a4c5d65badb53c7e98ac59feaeb29a31b
3
+ metadata.gz: 25f8f02e82db016ae0294993ad97c205d9560fce8fa12358022114866e92bf08
4
+ data.tar.gz: c9f2c79541bd7f04084608c000f09dce9b7b2db4a4d983c473207a1e1f001374
5
5
  SHA512:
6
- metadata.gz: 189df7bd4366010e43c43f6e5e6f031a02e4671a98a7e6ae49f6260253411e56c0fce1d0440fc3b8c9bd8881c5c259667b50df95d10a58de242dc170c25e0556
7
- data.tar.gz: 230eaf359d9a14414c175c89bd43e5bb415422d641dca967bc0a2266fb5779a1f9092dcf3c1e63761cc2c0ce86c565f3a40e01809ff240e3e31498521d44ef68
6
+ metadata.gz: 5366548250b651add0e834b094a8397556ee8912620dd6d334de5131473a0dafa420e4df43a6f805455df5de062bc00ad36eb2991aa80f2afd039a2b9a0eb6ba
7
+ data.tar.gz: 2e2cd9e4cfd83152221c4c96defdc784a4332fee4c36349615b7d21697d622cef89be8bab52ce48c2acc5c8dd5216bc051cc3c28097747bd74f841568aa6232b
@@ -114,11 +114,13 @@ module Vmpooler
114
114
  end
115
115
 
116
116
  def export_tags(backend, hostname, tags)
117
- tags.each_pair do |tag, value|
118
- next if value.nil? or value.empty?
117
+ backend.pipelined do
118
+ tags.each_pair do |tag, value|
119
+ next if value.nil? or value.empty?
119
120
 
120
- backend.hset('vmpooler__vm__' + hostname, 'tag:' + tag, value)
121
- backend.hset('vmpooler__tag__' + Date.today.to_s, hostname + ':' + tag, value)
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
- if host
300
- throw :stop_checking
301
- else
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 = RbVmomi::VIM.VirtualMachineConfigSpec(
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)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Vmpooler
4
- VERSION = '0.16.0'
4
+ VERSION = '0.18.0'
5
5
  end
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.16.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-08 00:00:00.000000000 Z
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.0
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.0
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