Microsoft Virtualization Discussions

Finding Volumes with Compression Enabled

JBIDDLE2212
5,608 Views

I was wondering if anyone could help me make a powershell script that could be run against a filer to identify volumes that have compression enabled.  I know how to manually check each volume, but I'm having trouble developing anything that could just tell me if the compression feature is enabled.

 

I've tried using different cmdlets like Get-NaVolOption but I can't seem to get anything that will just list out the volume name, and whether compression is enabled or disabled.

 

I would be fine with just a list of compression enabled volumes or with a list of all volumes displaying the compression status (on or off).

 

I'm working with DataONTAP 8.0.2P7 if that is of any relevance.

 

Any help is appreciated, thanks!

5 REPLIES 5

vinith
5,596 Views

You can use the Get-NaSis cmdlet to extract this information. an extract from the cmdlet help is illustrated below.

 

C:\PS>Get-NaSis xendesktopxp


Gets the dedupe status for volume 'xendesktopxp'.

 

BlocksSkippedSharing : 0
ChangelogUsedPercent : 0
CheckpointOpType : -
CheckpointProgress : -
CheckpointStage : -
CheckpointSubStage : -
CheckpointTime : 0
IsCompressionEnabled : False
IsInlineCompressionEnabled : False
LastOperationBeginTimestamp : 1327035978
LastOperationEndTimestamp : 1327038050
LastOperationError :
LastOperationSize : 2364 MB
LastOperationSizeBytes : 2478915584
LastOperationState : success
LastSuccessOperationBeginTimestamp : 1327035978
LastSuccessOperationEndTimestamp : 1327038050
LogicalData : DataONTAP.Types.Sis.LogicalData
MinimumBlocksShared : 1
Path : /vol/xendesktopxp
Progress : Idle for 20:11:38
QueuedJobType : -
Schedule : sun-sat@0
StaleFingerprintPercentage : 0
State : Enabled
Status : Idle
Type : Regular

JBIDDLE2212
5,588 Views

Vinith,

 

Thank you for your response.  I have successfully been able to find out if a parcitular volume has compression enabled, but we have over 400 volumes spread accross 2 controllers.  I need to generate a list from each controller either listing just the volumes that have compression enabled, or a list that shows all volumes that indicates whether the compression status is off or on.  That's where I'm having the real trouble.

vinith
5,580 Views

Can you try this.

 

 


function Get-VolCompression ($controllernames,$exportdetails){

$array = @()

$controllernamesdetails = Get-Content $controllernames


foreach ($control in $controllernamesdetails)

{

$controllerdetails = Connect-NaController $control -Credential (Get-Credential)


$props = Get-NaVol | Get-NaSis

$object = New-Object psobject -Property @{

 

'ControllerName' = $props.Name
'VolumeName' = $props.Path
'IsCompressionEnabled' = $props.IsCompressionEnabled

}

$array+=$object


}

$array

$array | Export-Csv -Path $exportdetails


}


#Example
#Get-VolCompression -controllernames "c:\filer.txt" -exportdetails "c:\data"

 

JBIDDLE2212
5,573 Views

I think I was able to get the list I needed by running the following against each controller:

 

Get-NaSis | select path,iscompressionenabled

vinith
5,566 Views

Thats great.

 

"Please remember to mark as answer if the solution helped you."

Public