Class: LinuxAdmin::VolumeGroup
- Inherits:
-
Object
- Object
- LinuxAdmin::VolumeGroup
- Defined in:
- lib/linux_admin/volume_group.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
volume group name.
Class Method Summary collapse
Instance Method Summary collapse
- #attach_to(lv) ⇒ Object
- #extend_with(pv) ⇒ Object
-
#initialize(args = {}) ⇒ VolumeGroup
constructor
other fields available volume group access volume group status internal volume group number maximum number of logical volumes current number of logical volumes open count of all logical volumes in this volume group maximum logical volume size maximum number of physical volumes current number of physical volumes actual number of physical volumes size of volume group in kilobytes physical extent size total number of physical extents for this volume group allocated number of physical extents for this volume group free number of physical extents for this volume group uuid of volume group.
Constructor Details
#initialize(args = {}) ⇒ VolumeGroup
other fields available volume group access volume group status internal volume group number maximum number of logical volumes current number of logical volumes open count of all logical volumes in this volume group maximum logical volume size maximum number of physical volumes current number of physical volumes actual number of physical volumes size of volume group in kilobytes physical extent size total number of physical extents for this volume group allocated number of physical extents for this volume group free number of physical extents for this volume group uuid of volume group
24 25 26 |
# File 'lib/linux_admin/volume_group.rb', line 24 def initialize(args = {}) @name = args[:name] end |
Instance Attribute Details
#name ⇒ Object
volume group name
4 5 6 |
# File 'lib/linux_admin/volume_group.rb', line 4 def name @name end |
Class Method Details
.create(name, pv) ⇒ Object
41 42 43 44 45 46 47 48 49 |
# File 'lib/linux_admin/volume_group.rb', line 41 def self.create(name, pv) self.scan # initialize local volume groups Common.run!(Common.cmd(:vgcreate), :params => [name, pv.device_name]) vg = VolumeGroup.new :name => name pv.volume_group = vg @vgs << vg vg end |
.scan ⇒ Object
51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/linux_admin/volume_group.rb', line 51 def self.scan @vgs ||= begin vgs = [] out = Common.run!(Common.cmd(:vgdisplay), :params => {'-c' => nil}).output out.each_line do |line| fields = line.lstrip.split(':') vgs << VolumeGroup.new(:name => fields[0]) end vgs end end |