knife-vsphere 2.0.1 → 2.0.2

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: dc8369abb89134912a7e683ce60b1bbd0e8d484f
4
- data.tar.gz: 813c2580d02825cd3d14376b5a4e18d982cb6cf7
3
+ metadata.gz: 4e7d771892c01c114d0b2ae5b9b2ab7141d61ec7
4
+ data.tar.gz: f46bfb78ccd6f6592cc2665b28fcf988729738c9
5
5
  SHA512:
6
- metadata.gz: 46f01a944324a64476df295187ba4859ade28677c4a47c62c3e1603e1804150fa60d0db72fa2ac829e0f14e49cb8a4e05ff9646abd4f30674bbf727fbb088d61
7
- data.tar.gz: ccaa4f2c5d8a44349ad90e36a56c041f10ecb9479062daa44fd63953c9f8b41440b3cc259571db7e76f5c55bba16d062f293a056c1cbc32441fce9e5a526d3f3
6
+ metadata.gz: 5ca0f046ff4ce88d80b37f78205a8186979bcca9402c9bbbcff7ac1fc55b009661bf35ff078a1fef3a0d53d38f17f75693e574b9b00badda0b7b634144b1ceb3
7
+ data.tar.gz: 7d355eaac4b81689489aa2dda67559c934a609ffef5a5b94e74400e34701515d47904aa1fd540ca24a6f5177d64bb5715adcfdc4ad33b5abda360882d585eee3
@@ -376,7 +376,17 @@ class Chef::Knife::VsphereVmClone < Chef::Knife::BaseVsphereCommand
376
376
 
377
377
  pp clone_spec if log_verbose?
378
378
 
379
- task.wait_for_completion
379
+ begin
380
+ task.wait_for_completion
381
+ rescue RbVmomi::Fault => e
382
+ fault = e.fault
383
+ if fault.class == RbVmomi::VIM::NicSettingMismatch
384
+ abort "There is a mismatch in the number of NICs on the template (#{fault.numberOfNicsInVM}) and what you've passed on the command line with --cips (#{fault.numberOfNicsInSpec}). The VM has been cloned but not customized."
385
+ else
386
+ raise e
387
+ end
388
+ end
389
+
380
390
  puts "Finished creating virtual machine #{vmname}"
381
391
 
382
392
  if customization_plugin && customization_plugin.respond_to?(:reconfig_vm)
@@ -70,8 +70,7 @@ class Chef::Knife::VsphereVmDelete < Chef::Knife::BaseVsphereCommand
70
70
  vmname = config[:chef_node_name] if config[:chef_node_name]
71
71
  destroy_item(Chef::Node, vmname, 'node')
72
72
  destroy_item(Chef::ApiClient, vmname, 'client')
73
- else
74
- puts "Corresponding node and client for the #{vmname} server were not deleted and remain registered with the Chef Server"
73
+ puts "Corresponding node and client for the #{vmname} server were deleted and unregistered with the Chef Server"
75
74
  end
76
75
  end
77
76
  end
@@ -60,6 +60,11 @@ class Chef::Knife::VsphereVmSnapshot < Chef::Knife::BaseVsphereCommand
60
60
  description: 'Quiesce the VM prior to snapshotting',
61
61
  default: false
62
62
 
63
+ option :snapshot_description,
64
+ long: '--snapshot-descr DESCR',
65
+ description: 'Snapshot description',
66
+ default: ''
67
+
63
68
  def run
64
69
  $stdout.sync = true
65
70
 
@@ -94,7 +99,7 @@ class Chef::Knife::VsphereVmSnapshot < Chef::Knife::BaseVsphereCommand
94
99
 
95
100
  if get_config(:create_new_snapshot)
96
101
  snapshot_task = vm.CreateSnapshot_Task(name: get_config(:create_new_snapshot),
97
- description: '',
102
+ description: get_config(:snapshot_description),
98
103
  memory: get_config(:dump_memory),
99
104
  quiesce: get_config(:quiesce))
100
105
  snapshot_task = snapshot_task.wait_for_completion if get_config(:wait)
@@ -142,12 +147,13 @@ class Chef::Knife::VsphereVmSnapshot < Chef::Knife::BaseVsphereCommand
142
147
  end
143
148
 
144
149
  def display_node(node, current, shift = 1)
150
+ descr = node.name + ' ' + node.createTime.iso8601
145
151
  out = ''
146
152
  out << '+--' * shift
147
153
  if node.snapshot == current
148
- out << "#{ui.color(node.name, :cyan)}" << "\n"
154
+ out << ui.color(descr, :cyan) << '\n'
149
155
  else
150
- out << "#{node.name}" << "\n"
156
+ out << descr << '\n'
151
157
  end
152
158
  unless node.childSnapshotList.empty?
153
159
  node.childSnapshotList.each { |item| out << display_node(item, current, shift + 1) }
@@ -1,5 +1,5 @@
1
1
  # The main knife-vsphere module.
2
2
  module KnifeVsphere
3
3
  # The version of this gem.
4
- VERSION = '2.0.1'
4
+ VERSION = '2.0.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knife-vsphere
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ezra Pagel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-11 00:00:00.000000000 Z
11
+ date: 2018-02-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: knife-windows
@@ -222,7 +222,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
222
222
  version: '0'
223
223
  requirements: []
224
224
  rubyforge_project:
225
- rubygems_version: 2.6.11
225
+ rubygems_version: 2.6.14
226
226
  signing_key:
227
227
  specification_version: 4
228
228
  summary: vSphere Support for Knife