Microsoft Virtualization Discussions

Get-NaSnapshotDelta

JSHACHER11

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

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

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

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

billyd

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

JGPSHNTAP

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

thanks guys!

Announcements
NetApp on Discord Image

We're on Discord, are you?

Live Chat, Watch Parties, and More!

Explore Banner

Meet Explore, NetApp’s digital sales platform

Engage digitally throughout the sales process, from product discovery to configuration, and handle all your post-purchase needs.

NetApp Insights to Action
I2A Banner
Public