Microsoft Virtualization Discussions

Get-NcEfficiency vs DataProtection SVM

storageguy

Heelo PS Toolkit gurus,

 

My code (browed from here and modified to my purpose).

 

$DataVservers = Get-NcVserver | Where-Object {$_.VserverType -eq "data"}
ForEach ($Vserver in $DataVservers) {
Get-NcEfficiency -vserver $Vserver | 
Sort-Object vserver | Select-Object Vserver, Name, @{ 'N'="Cpacity"; "E"={ ConvertTo-FormattedNumber -Type DataSize -NumberFormatString "0.00" -Value $_.Capacity }}, @{ 'N'="Used"; "E"={ ConvertTo-FormattedNumber -Type DataSize -NumberFormatString "0.00" -Value $_.Used }}, @{ 'N'="Free"; "E"={ ConvertTo-FormattedNumber -Type DataSize -NumberFormatString "0.00" -Value $_.Free }} |format-table -Autosize
}

 

There is a dataprotection SVM on the cluster. Script displays ok until hit the DR-SVM. It throws this error and continue with the rest of the SVMs

 

 

Get-NcEfficiency : Object reference not set to an instance of an object.
At line:2 char:1
+ Get-NcEfficiency -vserver $Vserver |
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (xx.xxx.xxx.xxx:NcController) [Get-NcEfficiency], NullReferenceException
+ FullyQualifiedErrorId : ApiException,DataONTAP.C.PowerShell.SDK.Cmdlets.Toolkit.Efficiency.GetNcEfficiency

 

Any work around to supress this error and display the data for the DR-SVM also?

 

Thanks

2 REPLIES 2

storageguy

Unfortunatly, that didn't solve the issue. Error message still appearing and I still want my DR SVM volumes also included in the report. BTW: all my SVMs are data and subtype default (except node ones and admin one)

 

Thanks again looking into this. 

asulliva

Hello @storageguy,

 

You'll want to add an additional filter to your query for the SVM sub-type...

 

Get-NcVserver -Query @{ VserverType = "data"; "VserverSubtype" = "default" }

There are four possible values for the sub-type:

 

  • default - normal SVMs
  • dp_destination - SVM-DR destination
  • sync_source - MetroCluster source SVM
  • sync_destination - MetroCluster destination SVM

Add/remove them from your query to get the type needed.

 

Hope that helps.

 

Andrew

If this post resolved your issue, please help others by selecting ACCEPT AS SOLUTION or adding a KUDO.
Announcements
Register for Insight 2021 Digital

INSIGHT 2021 Digital: Meet the Specialists 2

On October 20-22, gear up for a fully digital, totally immersive virtual experience with a downright legendary lineup of world-renowned specialists. Tune in for visionary conversations, solution deep dives, technical sessions and more.

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