Class: Virt::VMWare::Host
- Inherits:
-
Host
- Object
- Connection
- Host
- Virt::VMWare::Host
- Defined in:
- lib/virt/vmware/host.rb
Instance Attribute Summary
Attributes inherited from Host
Attributes inherited from Connection
Instance Method Summary collapse
- #create_guest(opts) ⇒ Object
- #interface(iface) ⇒ Object
-
#interfaces ⇒ Object
Available libvirt interfaces, excluding lo.
-
#networks ⇒ Object
libvirt internal networks.
Methods inherited from Host
#defined_guests, #find_guest_by_id, #find_guest_by_name, #guests, #initialize, #name, #running_guests, #storage_pool, #storage_pools, #volumes
Methods inherited from Connection
#closed?, #disconnect, #host, #initialize, #secure?, #version
Constructor Details
This class inherits a constructor from Virt::Host
Instance Method Details
#create_guest(opts) ⇒ Object
22 23 24 |
# File 'lib/virt/vmware/host.rb', line 22 def create_guest opts Virt::VMWare::Guest.new opts end |
#interface(iface) ⇒ Object
11 12 13 |
# File 'lib/virt/vmware/host.rb', line 11 def interface iface connection.lookup_interface_by_name(iface) end |
#interfaces ⇒ Object
Available libvirt interfaces, excluding lo
5 6 7 8 9 |
# File 'lib/virt/vmware/host.rb', line 5 def interfaces connection.list_interfaces.delete_if{|i| i == "lo"}.sort rescue => e raise "This function is not supported by the hypervisor: #{e}" end |
#networks ⇒ Object
libvirt internal networks
16 17 18 19 20 |
# File 'lib/virt/vmware/host.rb', line 16 def networks connection.list_networks.map do |network| connection.lookup_network_by_name(network).bridge_name end end |