class ForemanAP::Volume

A disk volume attached to a virtual machine.

Public Class Methods

new(pool, name) click to toggle source
# File lib/foreman_vm/volume.rb, line 20
def initialize(pool, name)
  @pool = pool
  @name = name
  @vol = pool.lookup_volume_by_name(name)
end

Public Instance Methods

delete() click to toggle source

Delete the volume.

# File lib/foreman_vm/volume.rb, line 15
def delete
  @vol.delete
  true
end
format() click to toggle source

The format of the volume. Currently, only :raw is supported.

# File lib/foreman_vm/volume.rb, line 5
def format
  case @vol.info.type
  when 0
    :raw
  else
    raise 'unknown volume type: ' + @sph.info.type
  end
end