Tag Archives: powershell

Powersehll netapp volume resize

This script will resize any volumes on your controller that are more full than 96% and add an extra 5% on to them. You  can filter the list a little more if needed, for example I don’t attempt to resize any of our volumes that have the word “dr” in as they are snapmirror destinations.

 

 

$controllers = @(“controller1″,”controller2″)
$body=””
$resize=””
$emailto=”fillThisIn”
$emailfrom = “fillThisIn”
$emailsmtp = fillThisIn”
$emailsubject= “Drives resized”

foreach ($controller in $controllers){
connect-nacontroller $controller
$resize+= (Get-NaVol | where-object {$_.used -gt 96 } | ft -HideTableHeaders)
}

if ($resize -ne “”) {
foreach ($navol in $resize){
write-host “$navol”
Set-NaVolSize $navol +5%
$newsize = Get-NaVolSize $navol.SizeTotal
Set-NaVolAutosize $navol -Enabled
Set-NaVolAutosize $navol -MaximumSize +10%
$body += “Volume $navol on $controller script resized to $newsize and autogrow enabled `n”
}
$body += “check snapmirror destinations size for volumes above!”
send-mailmessage -to $emailto -from $emailfrom -smtpserver $emailsmtp -subject $emailsubject -body $body
}