XObject
A Physical Host
xen-api: Class host
require ‘pangea’
host = Host.connect('http://xen.example.net’, ‘username’, ‘password’)
Connect to the Host xml-rpc server
Returns a Pangea::Host object
There’s no direct mapping to xen-api
# File lib/pangea/objects.rb, line 198 def self.connect(url, username, password) @link = Link.new(url, username, password) @link.connect @ref = @link.client.call('host.get_all', @link.sid)['Value'][0] Host.new(@link, @ref) end
Checks if the connection to the host xml-rpc server is alive
There’s no direct mapping to xen-api
# File lib/pangea/objects.rb, line 221 def alive? begin ref_call :get_uuid rescue Exception => e puts e.message return false end true end
Get the list of resident virtual machines controlled by the hypervisor.
Returns an Array of Pangea::HostCpu objects
xen-api: host.get_host_cpus
# File lib/pangea/objects.rb, line 120 def cpus list = [] ref_call(:get_host_CPUs).each do |hcpu| list << HostCpu.new(@link, hcpu) end list end
Returns the label of the Host (hostname)
# File lib/pangea/objects.rb, line 92 def label ref_call :get_name_label end
Get the Pangea::HostMetrics object for this host
xen-api: host.get_metrics
# File lib/pangea/objects.rb, line 161 def metrics HostMetrics.new(@link, ref_call(:get_metrics)) end
Returns the list of networks available in this host
If you are using a bridged network configuration (‘network-script network-bridge’ in xend-config.sxp), it will return an Array of Pangea::Network objects available in the host, one for each bridge available.
There’s no direct mapping to xen-api AFAIK
# File lib/pangea/objects.rb, line 175 def networks nets = [] p = @link.client.proxy( 'network' ) p.get_all(@link.sid)['Value'].each do |ref| nets << Network.new(@link, ref) end nets end
Reconnect to the Host
There’s no direct mapping to xen-api
# File lib/pangea/objects.rb, line 210 def reconnect raise LinkConnectError.new("You need to connect at least once before reconnecting") if @link.nil? @link.connect @ref = @link.client.call('host.get_all', @link.sid)['Value'][0] end
Get the list of resident virtual machines controlled by the hypervisor.
Returns an Array of Pangea::VM objects
xen-api: host.get_resident_VMs
# File lib/pangea/objects.rb, line 104 def resident_vms vms = [] ref_call(:get_resident_VMs).each do |vm| vms << VM.new(@link, vm) end vms end
Get the Xen scheduling policy
Returns a string
xen-api: host.get_sched_policy
# File lib/pangea/objects.rb, line 152 def sched_policy ref_call :get_sched_policy end
List some properties from the hypervisor:
machine: Host Architecture Xen: Xen Version system: Host OS (i.e. Linux) release: Xen Kernel Version host: hostname
Returns a Hash
xen-api: host.get_software_version
# File lib/pangea/objects.rb, line 141 def software_version ref_call :get_software_version end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.