HPUX::LVM

Perl function to handle HPUX LVM structure
Download

HPUX::LVM Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Christopher White
  • Publisher web site:
  • http://search.cpan.org/~cwhite/

HPUX::LVM Tags


HPUX::LVM Description

Perl function to handle HPUX LVM structure HPUX::LVM is a Perl module that takes the output from the LVM Commands vgdisplay and lvdisplay and pvdisplay and puts them in a hash of hashes in the following manner as an example: '/dev/vg08' => HASH(0x404214c8) 'Act_PV' => 4 'Alloc_PE' => 4092 'Cur_LV' => 2 'Cur_PV' => 4 'Free_PE' => 0 'Max_LV' => 255 'Max_PE_per_PV' => 1023 'Max_PV' => 16 'Open_LV' => 2 'PE_Size_Mbytes' => 4 'Physical_Vols' => HASH(0x40421510) '/dev/dsk/c3t12d0' => HASH(0x404215a0) 'Free_PE' => 0 'PV_Status' => 'available' 'Total_PE' => 1023 '/dev/dsk/c3t13d0' => HASH(0x40421528) 'Free_PE' => 0 'PV_Status' => 'available' 'Total_PE' => 1023 '/dev/dsk/c3t14d0' => HASH(0x40421564) 'Free_PE' => 0 'PV_Status' => 'available' 'Total_PE' => 1023 '/dev/dsk/c3t15d0' => HASH(0x404215dc) 'Free_PE' => 0 'PV_Status' => 'available' 'Total_PE' => 1023 'Total_PE' => 4092 'Total_PVG' => 0 'VGDA' => 8 'VG_Status' => 'available' 'VG_Write_Access' => 'read/write' 'lvols' => HASH(0x4042166c) 'lvol1' => HASH(0x40421684) 'Allocated_PE' => 2046 'Current_LE' => 2046 'LV_Size' => 8184 'LV_Status' => 'available/syncd' 'PV_Data' => HASH(0x4042178c) '/dev/dsk/c3t14d0' => HASH(0x404217a4) 'le_on_pv' => 1023 'pe_on_pv' => 1023 '/dev/dsk/c3t15d0' => HASH(0x404217d4) 'le_on_pv' => 1023 'pe_on_pv' => 1023 'Used_PV' => 2 'lvdata' => HASH(0x404216b4) 'Allocated_PE' => 2046 'Allocation' => 'strict' 'Bad_block' => 'on' 'Consistency_Recovery' => 'MWC' 'Current_LE' => 2046 'IO_Timeout_Seconds' => 'default' 'LV_Permission' => 'read/write' 'LV_Size_Mbytes' => 8184 'LV_Status' => 'available/syncd' 'Mirror_copies' => 0 'Schedule' => 'parallel' 'Stripe_Size_Kbytes' => 0 'Stripes' => 0 'VG_Name' => '/dev/vg08' 'lvol2' => HASH(0x40422834) 'Allocated_PE' => 2046 'Current_LE' => 2046 'LV_Size' => 8184 'LV_Status' => 'available/syncd' 'PV_Data' => HASH(0x4042293c) '/dev/dsk/c3t12d0' => HASH(0x40422984) 'le_on_pv' => 1023 'pe_on_pv' => 1023 '/dev/dsk/c3t13d0' => HASH(0x40422954) 'le_on_pv' => 1023 'pe_on_pv' => 1023 'Used_PV' => 2 'lvdata' => HASH(0x40422864) 'Allocated_PE' => 2046 'Allocation' => 'strict' 'Bad_block' => 'on' 'Consistency_Recovery' => 'MWC' 'Current_LE' => 2046 'IO_Timeout_Seconds' => 'default' 'LV_Permission' => 'read/write' 'LV_Size_Mbytes' => 8184 'LV_Status' => 'available/syncd' 'Mirror_copies' => 0 'Schedule' => 'parallel' 'Stripe_Size_Kbytes' => 0 'Stripes' => 0 'VG_Name' => '/dev/vg08'each attribute is the same as output in the command but with underscores instead of spaces so "Allocated PE" is "Allocated_PE". I also had to add attributes "Physical_Vols","lvols","lvdata" and "PV_Data". (for logical volume data)"Physical_Vols" is a hash refrence to all the Physical Volumes in the VG"Alternate_Links" is an array refrence under each physical vol that contains all the links to that device (if any). First array element is "None" if there are no links. (Not listed above but its under "Physical_Vols""lvols" is a hash refrence to all the volume groups in the VG"lv_data" is a hash refrence to lvdisplays output of the logical volume."PV_Data" is a hash refrence to all the physical volumes that make up the volume group and how much space they use on each.The data can then be access through the provided methods (Subroutines).SYNOPSIS my $lvminfo_data = new HPUX::LVMInfo( target_type =>"local", persistance =>"new", access_prog =>"ssh", access_system =>"localhost", access_user =>"root" ); $arref2 = $lvminfo_data->get_all_volumegroups(); foreach $vg (@$arref2) { print "Volume Group: $vg "; push @save_vgs, $vg; $vg_save = $vg; } $arref2a = $lvminfo_data->get_vg_physicalvols( volume_group => $vg_save ); print "Physical vols in vg: $vg_save "; foreach $pvinvg (@$arref2a) { print "$pvinvg "; push @save_pvs, $pvinvg; $pvinvg_save = $pvinvg; } Requirements: · Perl


HPUX::LVM Related Software