clc-chef-metal-vsphere 0.3.2 → 0.3.3

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: 30ca8337aad8fb990cd2be047ae531f283da2a5a
4
- data.tar.gz: e9d7037e74152546784045c3821bd96dd342008f
3
+ metadata.gz: fe331e4128b27e53d0c72452736f3ae651fafc44
4
+ data.tar.gz: b5fb62b6fd123c8348ced5067ee122d124a70d12
5
5
  SHA512:
6
- metadata.gz: dc1fdc88af6f42f22d995b43e6bec397f9b1119fb01c054329b07c18101c1c1f09972a9e6ef14b51aad39da431bb50624de1063e8ecc3e1b591cdd70751ab7f1
7
- data.tar.gz: 22327524c3ca5b889de9c4bfca907a9479445b384c67d5981a27989a599268223b84eeab3c220dabc1b5ad0326883f232f77611cc375a82dcd23b5e8ab1bf522
6
+ metadata.gz: 15973237344a53882facf5e6ffb12a7d78f18ba1e2873e3e5f67681ec93b53ab1b1e8a0d935dbcafa16dc7b410ba06a1958146132a4125ead2c3e6ba2120f268
7
+ data.tar.gz: fe936bf2633196eefc976c5d730e8b44d1d6380bc289bf625d56b0cec79e21e0b0c03f7d96a337515fbe0d3fd4a3122ed482d069fbd361b5086575abf61d2745
@@ -1,3 +1,3 @@
1
1
  module ChefMetalVsphere
2
- VERSION = '0.3.2'
2
+ VERSION = '0.3.3'
3
3
  end
@@ -164,17 +164,22 @@ module ChefMetalVsphere
164
164
  end
165
165
 
166
166
  unless options[:network_name].to_s.nil?
167
- network = find_network(datacenter, options[:network_name])
168
- card = vm_template.config.hardware.device.grep(RbVmomi::VIM::VirtualEthernetCard).first
169
- begin
170
- switch_port = RbVmomi::VIM.DistributedVirtualSwitchPortConnection(:switchUuid => network.config.distributedVirtualSwitch.uuid, :portgroupKey => network.key)
171
- card.backing.port = switch_port
172
- rescue
173
- # not connected to a distibuted switch?
174
- card.backing.deviceName = options[:network_name]
175
- end
176
- dev_spec = RbVmomi::VIM.VirtualDeviceConfigSpec(:device => card, :operation => "edit")
177
- clone_spec.config.deviceChange.push dev_spec
167
+ config_spec_operation = RbVmomi::VIM::VirtualDeviceConfigSpecOperation('edit')
168
+ nic_backing_info = RbVmomi::VIM::VirtualEthernetCardNetworkBackingInfo(:deviceName => options[:network_name])
169
+ connectable = RbVmomi::VIM::VirtualDeviceConnectInfo(
170
+ :allowGuestControl => true,
171
+ :connected => true,
172
+ :startConnected => true)
173
+ device = RbVmomi::VIM::VirtualE1000(
174
+ :backing => nic_backing_info,
175
+ :deviceInfo => RbVmomi::VIM::Description(:label => "Network adapter 1", :summary => options[:network_name]),
176
+ :key => 4000,
177
+ :connectable => connectable)
178
+ device_spec = RbVmomi::VIM::VirtualDeviceConfigSpec(
179
+ :operation => config_spec_operation,
180
+ :device => device)
181
+
182
+ clone_spec.config.deviceChange.push device_spec
178
183
  end
179
184
 
180
185
  vm_template.CloneVM_Task(
@@ -211,11 +216,6 @@ module ChefMetalVsphere
211
216
  vm
212
217
  end
213
218
 
214
- def find_network(dc, network_name)
215
- baseEntity = dc.network
216
- baseEntity.find { |f| f.name == network_name } or raise "no such network #{network_name}"
217
- end
218
-
219
219
  def find_datastore(dc, datastore_name)
220
220
  baseEntity = dc.datastore
221
221
  baseEntity.find { |f| f.info.name == datastore_name } or raise "no such datastore #{datastore_name}"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clc-chef-metal-vsphere
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - CenturyLink Cloud
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-17 00:00:00.000000000 Z
11
+ date: 2014-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chef