Microsoft Virtualization Discussions


Hi guys,

I am trying to list Delta of all snapshots in a volume

this doesn't work:

$snaps = Get-NaSnapshot -TargetName vol1

$snaps | foreach {Get-NaSnapshotDelta | ft -AutoSize}

neither does this:

foreach ($snap in $snaps) {Get-NaSnapshotDelta}

nor this:

foreach ($snap in $snaps) {Get-NaSnapshotDelta $snap}

(still asking for snapshot name)

any idea?



Re: Get-NaSnapshotDelta

If you are looking for the sum of all of the snapshots in a volume give this a shot:

$v = get-nasnapshot -targetname <VOLUME NAME> | measure-object total -sum;[math]::truncate($v.sum / 1gb)

I'm not sure how to get it done without a variable.

Re: Get-NaSnapshotDelta

Yes, we need to understand why you are trying to use snapshot delta in the first place..

Billyd, -

IMHO - Here is the way you should do it using the cmdlets from netapp

convertto-formattednumber ((get-navol vol0 | get-nasnapshot  | measure -property Total -sum).sum) data

size "0.0"

4.5 GB

You can you system.math .net functions, but yours should look something like this

[math]::round(((get-navol vol0 | get-nasnapshot | measure -property Total -sum).sum/1gb),2)


View solution in original post

Re: Get-NaSnapshotDelta

Thanks JGP - I didn't know about the convertto-formattednumber cmdlet.  Much better than what I was using.

Re: Get-NaSnapshotDelta

Yeah, it was written for the module so I figured I use it when I can..

If not, i use the .net math functions

Re: Get-NaSnapshotDelta

thanks guys!

Review Banner
All Community Forums