Class: ForemanAP::Volume
- Inherits:
-
Object
- Object
- ForemanAP::Volume
- Defined in:
- lib/foreman_vm/volume.rb
Overview
A disk volume attached to a virtual machine.
Instance Method Summary collapse
-
#delete ⇒ Object
Delete the volume.
-
#format ⇒ Object
The format of the volume.
-
#initialize(pool, name) ⇒ Volume
constructor
A new instance of Volume.
Constructor Details
#initialize(pool, name) ⇒ Volume
Returns a new instance of Volume.
20 21 22 23 24 |
# File 'lib/foreman_vm/volume.rb', line 20 def initialize(pool, name) @pool = pool @name = name @vol = pool.lookup_volume_by_name(name) end |
Instance Method Details
#delete ⇒ Object
Delete the volume.
15 16 17 18 |
# File 'lib/foreman_vm/volume.rb', line 15 def delete @vol.delete true end |
#format ⇒ Object
The format of the volume. Currently, only :raw is supported.
5 6 7 8 9 10 11 12 |
# 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 |