class LVM::VolumeGroups

Public Class Methods

new(options) click to toggle source
# File lib/lvm/volume_groups.rb, line 13
def initialize(options)
  @vgs = VGS.new(options)
  @pvs = PhysicalVolumes.new(options)
  @lvs = LogicalVolumes.new(options)
end

Public Instance Methods

each() { |vg| ... } click to toggle source

Gather all information about volume groups and their underlying logical and physical volumes.

This is the best representation of LVM data.

# File lib/lvm/volume_groups.rb, line 23
def each 
  vgs = @vgs.list
  lvs = @lvs.list
  pvs = @pvs.list
  
  vgs.each do |vg|
    vg.logical_volumes  = lvs.select { |lv| lv.vg_uuid == vg.uuid }
    vg.physical_volumes = pvs.select { |pv| pv.vg_uuid == vg.uuid }
    yield vg
  end
end
list() click to toggle source
# File lib/lvm/volume_groups.rb, line 35
def list
  self.each { }
end