Class: RbVmomi::VIM::VirtualMachine

Inherits:
Object
  • Object
show all
Defined in:
lib/rbvmomi/vim/VirtualMachine.rb

Instance Method Summary collapse

Instance Method Details

#macsHash

Retrieve the MAC addresses for all virtual NICs.

Returns:

  • (Hash)

    Keyed by device label.



4
5
6
# File 'lib/rbvmomi/vim/VirtualMachine.rb', line 4

def macs
  Hash[self.config.hardware.device.grep(RbVmomi::VIM::VirtualEthernetCard).map { |x| [x.deviceInfo.label, x.macAddress] }]
end