Powershell Script to parse showpdvv data
Posted: Thu Nov 14, 2013 1:19 pm
Gentlemen,
I've been using this script quite a bit lately to balance some of our InServ's running 2.3.1 and 3.1.1. We purchased a few disk cages and due to the bug with tunesys in these InFormOS versions, I had to do it manually.
The script basically scans all PDID's in the input file and produces a report listing VV's and its User Chunklet usage. I use this script with 600+ PDID's to identify which VV's would reduce the most load and proceed to tune them to an interim CPG:
$pdIDs = Import-Csv C:\script\3par_tune\pdids.txt
$outfile = 'C:\script\3par_tune\vvperpd.txt'
$3par = 'IP'
$report = @()
foreach ($pdID in $pdIDs){
$id = $pdID.Id.ToString()
$vvs = C:\script\plink $3par -l username -pw password showpdvv -sum $pdID.Id | Select-String $id
foreach ($vv in $vvs){
$usrChunks = $vv.ToString().Split(" ",[StringSplitOptions]"RemoveEmptyEntries")[8]
if ([int]$usrChunks -gt 25){
$row = "" | Select PDId,Type,VVName,UsrChunks
$row.PDId = $id
$row.Type = $vv.ToString().Split(" ",[StringSplitOptions]"RemoveEmptyEntries")[2]
$row.VVName = $vv.ToString().Split(" ",[StringSplitOptions]"RemoveEmptyEntries")[5]
$row.UsrChunks = [int]$usrChunks
$report += $row
}
}
}
$report | Out-File $outfile
The script produces a report in this fashion:
PDId Type VVName UsrChunks
1584 FC VV1 43
1584 FC VV2 30
1584 FC VV3 36
1584 FC VV4 27
You can filter VV's with a number of User Chunklets using the -gt expression inside the if statement.
I've been using this script quite a bit lately to balance some of our InServ's running 2.3.1 and 3.1.1. We purchased a few disk cages and due to the bug with tunesys in these InFormOS versions, I had to do it manually.
The script basically scans all PDID's in the input file and produces a report listing VV's and its User Chunklet usage. I use this script with 600+ PDID's to identify which VV's would reduce the most load and proceed to tune them to an interim CPG:
$pdIDs = Import-Csv C:\script\3par_tune\pdids.txt
$outfile = 'C:\script\3par_tune\vvperpd.txt'
$3par = 'IP'
$report = @()
foreach ($pdID in $pdIDs){
$id = $pdID.Id.ToString()
$vvs = C:\script\plink $3par -l username -pw password showpdvv -sum $pdID.Id | Select-String $id
foreach ($vv in $vvs){
$usrChunks = $vv.ToString().Split(" ",[StringSplitOptions]"RemoveEmptyEntries")[8]
if ([int]$usrChunks -gt 25){
$row = "" | Select PDId,Type,VVName,UsrChunks
$row.PDId = $id
$row.Type = $vv.ToString().Split(" ",[StringSplitOptions]"RemoveEmptyEntries")[2]
$row.VVName = $vv.ToString().Split(" ",[StringSplitOptions]"RemoveEmptyEntries")[5]
$row.UsrChunks = [int]$usrChunks
$report += $row
}
}
}
$report | Out-File $outfile
The script produces a report in this fashion:
PDId Type VVName UsrChunks
1584 FC VV1 43
1584 FC VV2 30
1584 FC VV3 36
1584 FC VV4 27
You can filter VV's with a number of User Chunklets using the -gt expression inside the if statement.