# File lib/fog/libvirt/models/compute/pool.rb, line 21 def initialize(attributes={} ) # Can be created by passing in XML @xml = attributes.delete(:xml) super(attributes) end
Is the pool active or not?
# File lib/fog/libvirt/models/compute/pool.rb, line 64 def active? active end
Will the pool autostart or not?
# File lib/fog/libvirt/models/compute/pool.rb, line 69 def auto_start? autostart end
Build this storage pool
# File lib/fog/libvirt/models/compute/pool.rb, line 51 def build service.pool_action uuid, :build end
Destroys the storage pool
# File lib/fog/libvirt/models/compute/pool.rb, line 56 def destroy # Shutdown pool if active service.pool_action uuid, :destroy if active? # If this is a persistent domain we need to undefine it service.pool_action uuid, :undefine if persistent? end
Is the pool persistent or not?
# File lib/fog/libvirt/models/compute/pool.rb, line 74 def persistent? persistent end
# File lib/fog/libvirt/models/compute/pool.rb, line 27 def save raise Fog::Errors::Error.new('Creating a new pool requires proper xml') unless xml self.uuid = (persistent ? service.define_pool(xml) : service.create_pool(xml)).uuid reload end
Shuts down the pool
# File lib/fog/libvirt/models/compute/pool.rb, line 46 def shutdown stop end
Start the pool = make it active Performs a libvirt create (= start)
# File lib/fog/libvirt/models/compute/pool.rb, line 35 def start service.pool_action uuid, :create end
Stop the pool = make it non-active Performs a libvirt destroy (= stop)
# File lib/fog/libvirt/models/compute/pool.rb, line 41 def stop service.pool_action uuid, :destroy end
Retrieves the volumes of this pool
# File lib/fog/libvirt/models/compute/pool.rb, line 79 def volumes service.list_pool_volumes uuid end