Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #for explanation go to http://en.community.dell.com/support-forums/storage/f/3775/t/19641253?pi21859=2
- #by Florian Schneider
- ### set Values here ###
- $GroupIP = "127.0.0.1"
- $GroupUserName = "youruser"
- $GroupPassword = "yourpass"
- $desiredpercentfree = "87"
- cls
- $starttime = Get-Date
- Function do-log {
- param([Parameter(ValueFromPipeline=$true)]$pip, $par)
- $logtime = (get-date) - $starttime
- Write-Host $logtime $pip -ForegroundColor Yellow
- }
- Import-Module "c:\program files\EqualLogic\bin\EqlPSTools.dll"
- Connect-EqlGroup -GroupAddress $GroupIP -UserName $GroupUserName -Password $GroupPassword -IgnoreSavedCredentials
- "getting Volumes" | do-log
- $volumes = Get-EqlVolume
- $volumes.Count.ToString() + " Volumes Found, removing " + ($volumes | where ISThinProvision -eq $False).count + " none thin Volumes" | do-log
- $volumes = $volumes | where ISThinProvision -eq $true
- Function EQL-SetNewThinPercent {
- "Starting Calculate" | do-log
- $actualpercent = [int]$vol.ThinProvisionMinReservePercent
- do {
- "recalculateing" | do-log
- #$vol.VolumeName
- [string]$actualpercent + " set, trying " + ([int]$actualpercent+1) | do-log
- $actualpercent = [int]$actualpercent+1
- "new warninig percent would be: " + [math]::Round($vol.AllocatedMB *100 / ($vol.VolumeSizeMB * ($actualpercent/100)),2) | do-log
- }
- until ($vol.AllocatedMB *100 / ($vol.VolumeSizeMB * ($actualpercent/100)) -lt $desiredpercentfree)
- "Found new percentage, setting: " + $actualpercent + " instead of: " + $vol.ThinProvisionMinReservePercent | do-log
- #uncomment this line to automatically set the calculated percentage
- #Set-EqlVolume -VolumeName $vol.VolumeName -ThinProvisionMinReservePercent $actualpercent
- }
- foreach ($vol in $volumes){
- $vol.VolumeName | do-log
- "Now Percent set: " + $vol.ThinProvisionMinReservePercent | do-log
- $warningpercent = [math]::Round($vol.AllocatedMB *100 / $vol.DynamicThinReserveMB,2)
- "Reseve Percent = " + $warningpercent | do-log
- if ($warningpercent -gt 90) {
- "! Warning over 90% !" | do-log
- EQL-SetNewThinPercent
- }else{
- "OK under 90 %" | do-log
- }
- Write-Host ""
- }
- Disconnect-EqlGroup
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement