Microsoft Virtualization Discussions

Syntax for obtaining snap delta change rate on all volumes on a 7-mode?

rtriana
2,955 Views

Hi Communities, 

 

I am not a programmer ... and do not really have programming skills.   However, I am reaching out to communities because we need the syntax to get the change rate of all volumes on a 7-mode controller pair.    What would be the "for each" syntax so that we can run one command and get all the snap deltas for all the volumes in the HA pair?

 

get-nasnapshotdelta command ..

 

Thank you communities for your help.

 

Rick

1 REPLY 1

Aparajita
2,942 Views

Hello Rick,

 

The following script ought to do the trick.

 

$vols = Get-NaVol
Write-Host "Volume`tSnapshot`tConsumedSize`tElapsedTime"
foreach ($vol in $vols) {
	$snaps = Get-NaSnapshot $vol
	foreach ($snap in $snaps) {
		$res = Get-NaSnapshotDelta -TargetName $vol -SnapName1 $snap
		Write-Host $vol `t $snap `t $res.ConsumedSize `t $res.ElapsedTimeTS
	}
}

The output of the script would be

 

PS C:\Users\aparajir> & '..\SnapshotDelta.ps1'
Volume  Snapshot        ConsumedSize    ElapsedTime
vol0     hourly.0        8716288         02:59:14
vol0     hourly.1        42876928        14:58:49
vol0     hourly.2        54444032        18:59:24
vol0     hourly.3        65953792        22:58:54
vol0     hourly.4        77496320        1.02:59:26
vol0     hourly.5        111915008       1.14:58:59
vol0     nightly.0       31633408        10:59:25
vol0     nightly.1       100524032       1.10:59:31
vol1     hourly.0        61440   02:59:26
vol1     hourly.1        200704          14:59:02
vol1     hourly.2        270336          18:59:36
vol1     hourly.3        339968          22:59:06
vol1     hourly.4        409600          1.02:59:39
vol1     hourly.5        548864          1.14:59:11
vol1     nightly.0       131072          10:59:37
vol1     nightly.1       479232          1.10:59:44

Hope this helps!

Aparajita

 

 

Public