Skip to content

Commit

Permalink
Reconfigure VM: Add / Remove Network Adapters
Browse files Browse the repository at this point in the history
  • Loading branch information
kruge002 committed Dec 20, 2017
1 parent c4e11a6 commit d017d23
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lib/VMwareWebService/MiqVimVm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -925,6 +925,20 @@ def getDeviceKeysByBacking(backingFile, hardware = nil)
([nil, nil])
end # def getDeviceKeysByBacking

def getDeviceKeysByNetwork(networkName)
devs = getProp("config.hardware")["config"]["hardware"]["device"]
devs.each do |dev|
next if !["VirtualVmxnet3","VirtualE1000e","VirtualPCNet32"].include? dev.xsiType
next if dev["deviceInfo"]["label"] != networkName
controller_key = dev["controllerKey"]
key = dev["key"]
unitNumber = dev["unitNumber"]
return controller_key, key, unitNumber
end
# controller_key, key, unitNumber
([nil, nil, nil])
end

#####################
# Miq Alarm methods.
#####################
Expand Down

0 comments on commit d017d23

Please sign in to comment.