Can be created by passing in XML
# File lib/fog/libvirt/models/compute/pool.rb, line 17 def initialize(attributes={} ) self.xml ||= nil unless attributes[:xml] self.create_persistent ||= true unless attributes[:create_persistent] self.create_auto_build ||= true unless attributes[:create_auto_build] super end
Is the pool active or not?
# File lib/fog/libvirt/models/compute/pool.rb, line 96 def active? requires :raw @raw.active? end
Retrieves the allocated disk space of the pool
# File lib/fog/libvirt/models/compute/pool.rb, line 136 def allocation requires :raw @raw.info.allocation end
Set autostart value of the storage pool (true|false)
# File lib/fog/libvirt/models/compute/pool.rb, line 89 def auto_start=(flag) requires :raw @raw.auto_start(flag) end
Will the pool autostart or not?
# File lib/fog/libvirt/models/compute/pool.rb, line 103 def auto_start? requires :raw @raw.autostart? end
Build this storage pool
# File lib/fog/libvirt/models/compute/pool.rb, line 67 def build requires :raw @raw.build unless @raw.nil? end
Retrieves the capacity of disk space of the pool
# File lib/fog/libvirt/models/compute/pool.rb, line 142 def capacity requires :raw @raw.info.capacity end
Destroys the storage pool
# File lib/fog/libvirt/models/compute/pool.rb, line 74 def destroy( destroy_options={}) requires :raw # Shutdown pool if active @raw.destroy if @raw.active? # Delete corresponding data in this pool # @raw.delete # If this is a persistent domain we need to undefine it @raw.undefine if @raw.persistent? end
Retrieves the name of the pool
# File lib/fog/libvirt/models/compute/pool.rb, line 124 def name requires :raw @raw.name end
Retrieves the number of volumes available in this pool
# File lib/fog/libvirt/models/compute/pool.rb, line 148 def num_of_volumes requires :raw @raw.num_of_volumes end
Is the pool persistent or not?
# File lib/fog/libvirt/models/compute/pool.rb, line 110 def persistent? requires :raw @raw.persistent? end
# File lib/fog/libvirt/models/compute/pool.rb, line 24 def save requires :xml unless xml.nil? pool=nil if self.create_persistent pool=connection.raw.define_storage_pool_xml(xml) else pool=connection.raw.create_storage_pool_xml(xml) end self.raw=pool true else raise Fog::Errors::Error.new('Creating a new pool requires proper xml') false end end
Shuts down the pool
# File lib/fog/libvirt/models/compute/pool.rb, line 59 def shutdown requires :raw @raw.destroy true end
Start the pool = make it active Performs a libvirt create (= start)
# File lib/fog/libvirt/models/compute/pool.rb, line 44 def start requires :raw @raw.create end
# File lib/fog/libvirt/models/compute/pool.rb, line 153 def state requires :raw #INACTIVE = INT2NUM(VIR_STORAGE_POOL_INACTIVE) virStoragePoolState #BUILDING = INT2NUM(VIR_STORAGE_POOL_BUILDING) #RUNNING = INT2NUM(VIR_STORAGE_POOL_RUNNING) #DEGRADED = INT2NUM(VIR_STORAGE_POOL_DEGRADED) #INACCESSIBLE = INT2NUM(VIR_STORAGE_POOL_INACCESSIBLE) states=[:inactive, :building,:running,:degrated,:inaccessible] return states[@raw.info.state] end
Stop the pool = make it non-active Performs a libvirt destroy (= stop)
# File lib/fog/libvirt/models/compute/pool.rb, line 52 def stop requires :raw @raw.destroy end
Retrieves the uuid of the pool
# File lib/fog/libvirt/models/compute/pool.rb, line 130 def uuid requires :raw @raw.uuid end
Generated with the Darkfish Rdoc Generator 2.