Parent

Class/Module Index [+]

Quicksearch

Fog::Compute::XenServer::Host

Public Instance Methods

disable() click to toggle source

Puts the host into a state in which no new VMs can be started. Currently active VMs on the host continue to execute.

@see docs.vmd.citrix.com/XenServer/6.0.0/1.0/en_gb/api/?c=host

# File lib/fog/xenserver/models/compute/host.rb, line 84
def disable 
  service.disable_host(reference)
end
enable() click to toggle source

Puts the host into a state in which new VMs can be started.

@see docs.vmd.citrix.com/XenServer/6.0.0/1.0/en_gb/api/?c=host

# File lib/fog/xenserver/models/compute/host.rb, line 93
def enable
  service.enable_host(reference)
end
host_cpus() click to toggle source
# File lib/fog/xenserver/models/compute/host.rb, line 45
def host_cpus
  cpus = []
  (__host_cpus || []).each do |ref|
    cpu_ref = service.get_record(ref, 'host_cpu' )
    cpu_ref[:service] = service
    cpus << Fog::Compute::XenServer::HostCpu.new(cpu_ref)
  end
  cpus
end
metrics() click to toggle source
# File lib/fog/xenserver/models/compute/host.rb, line 55
def metrics
  return nil unless __metrics
  rec = service.get_record(__metrics, 'host_metrics' )
  Fog::Compute::XenServer::HostMetrics.new(rec)
end
pbds() click to toggle source
# File lib/fog/xenserver/models/compute/host.rb, line 33
def pbds
  __pbds.collect { |pbd| service.pbds.get pbd }
end
pifs() click to toggle source
# File lib/fog/xenserver/models/compute/host.rb, line 29
def pifs
  __pifs.collect { |pif| service.pifs.get pif }
end
reboot(auto_disable = true) click to toggle source

Reboot the host disabling it first unless auto_disable is set to false

This function can only be called if there are no currently running VMs on the host and it is disabled. If there are running VMs, it will raise an exception.

@param [Boolean] auto_disable disable the host first

@see docs.vmd.citrix.com/XenServer/6.0.0/1.0/en_gb/api/?c=host

# File lib/fog/xenserver/models/compute/host.rb, line 73
def reboot(auto_disable = true)
  disable if auto_disable
  service.reboot_host(reference)
end
resident_servers() click to toggle source
# File lib/fog/xenserver/models/compute/host.rb, line 37
def resident_servers
  __resident_vms.collect { |ref| service.servers.get ref }
end
resident_vms() click to toggle source
# File lib/fog/xenserver/models/compute/host.rb, line 41
def resident_vms
  resident_servers
end
set_attribute(name, *val) click to toggle source
# File lib/fog/xenserver/models/compute/host.rb, line 114
def set_attribute(name, *val)
  data = service.set_attribute( 'host', reference, name, *val )
  # Do not reload automatically for performance reasons
  # We can set multiple attributes at the same time and
  # then reload manually
  #reload
end
shutdown(auto_disable = true) click to toggle source

Shutdown the host disabling it first unless auto_disable is set to false.

This function can only be called if there are no currently running VMs on the host and it is disabled. If there are running VMs, it will raise an exception.

@param [Boolean] auto_disable disable the host first

@see docs.vmd.citrix.com/XenServer/6.0.0/1.0/en_gb/api/?c=host

# File lib/fog/xenserver/models/compute/host.rb, line 109
def shutdown(auto_disable = true)
  disable if auto_disable
  service.shutdown_host(reference)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.