Class: LVM::VolumeGroups
- Inherits:
-
Object
- Object
- LVM::VolumeGroups
- Defined in:
- lib/lvm/volume_groups.rb
Instance Method Summary collapse
-
#each ⇒ Object
Gather all information about volume groups and their underlying logical and physical volumes.
-
#initialize(options) ⇒ VolumeGroups
constructor
A new instance of VolumeGroups.
Methods included from Volumes
Constructor Details
#initialize(options) ⇒ VolumeGroups
Returns a new instance of VolumeGroups.
13 14 15 16 17 |
# File 'lib/lvm/volume_groups.rb', line 13 def initialize() @vgs = VGS.new() @pvs = PhysicalVolumes.new() @lvs = LogicalVolumes.new() end |
Instance Method Details
#each ⇒ Object
Gather all information about volume groups and their underlying logical and physical volumes.
This is the best representation of LVM data.
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/lvm/volume_groups.rb', line 23 def each vgs = @vgs.list vgs.each do |vg| vg.logical_volumes ||= [] @lvs.each do |lv| if lv.vg_uuid == vg.uuid vg.logical_volumes << lv end end vg.physical_volumes ||= [] @pvs.each do |pv| if pv.vg_uuid == vg.uuid vg.physical_volumes << pv end end end return vgs.each {|v| yield v} end |