NetApp Community Update
This site will enter Read Only mode on July 23 as we prepare to move to a new platform.
You will still be able to view content, but posting and replying will be temporarily disabled.
To learn more, please review the information in this blog post.

Microsoft Virtualization Discussions

Get-NaSnapshotDelta

JSHACHER11
6,936 Views

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?

tnx

1 ACCEPTED SOLUTION

JGPSHNTAP
6,936 Views

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)

4.5

View solution in original post

5 REPLIES 5

billyd
6,936 Views

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.

JGPSHNTAP
6,937 Views

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)

4.5

billyd
6,936 Views

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

JGPSHNTAP
6,936 Views

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

If not, i use the .net math functions

JSHACHER11
6,936 Views

thanks guys!

Public