Class: RbVmomi::VIM::VirtualMachine

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

Instance Method Summary collapse

Instance Method Details

#disksArray

Retrieve all virtual disk devices.

Returns:

  • (Array)

    Array of virtual disk devices.


10
11
12
# File 'lib/rbvmomi/vim/VirtualMachine.rb', line 10

def disks
  self.config.hardware.device.grep(RbVmomi::VIM::VirtualDisk)
end

#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