Microsoft Virtualization Discussions
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?
tnx
Solved! See The Solution
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
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.
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
Thanks JGP - I didn't know about the convertto-formattednumber cmdlet. Much better than what I was using.
Yeah, it was written for the module so I figured I use it when I can..
If not, i use the .net math functions
thanks guys!