Class: Xen::SR

Inherits:
Base
  • Object
show all
Defined in:
lib/xen/sr.rb

Class Method Summary collapse

Methods inherited from Base

#initialize, #record, #to_s, #uuid

Constructor Details

This class inherits a constructor from Xen::Base

Class Method Details

.get_local(host) ⇒ Object

Searches the host for the first storage resource with the type set to ‘local’



5
6
7
8
9
10
# File 'lib/xen/sr.rb', line 5

def self.get_local(host)
  host.get_value("SR.get_all").each do |sruid|
    return self.new(sruid, host) if host.get_value("SR.get_type", sruid) == 'local'
  end
  nil
end