Microsoft Virtualization Discussions

Get-NcNetFailoverGroup not working as expected

dmeyer
2,347 Views

Hi everyone.
 
I'm trying to use Get-NcNetFailoverGroup in one of my powershell scripts, but I can't get it to return anything at all.

The call to Get-NcNetFailoverGroup is basicly like this:

    $failovergroup =   Get-NcNetFailoverGroup -VserverContext $VServer
    Write-Host $failovergroup

but $failovergroup is just empty (even though the SVM has a lif, and that lif is using a failover group).

For example, this works just fine, and returns all details about the lifs, including the failover-group:

    $LIF_List = Get-NcNetInterface -Query $Query -VserverContext $VServer

So the basic connectivity from my script to the cluster works, I can query everything I want, just not the details of the failover group.

What I need is a list of target ports of the failover group, which should be returned by Get-NcNetFailoverGroup (at least the help/info to that command shows an example which contains exactly the info I need from the cluster).

I also checked the NetApp Docs sources, and the call to Get-NcNetFailoverGroup looks just like my call.

What am I doing wrong?

1 ACCEPTED SOLUTION

mbeattie
2,325 Views

Hi,

 

Is it possible that you have connected to a data vserver instead of the cluster management vserver? Try this:

 

Import-Module DataONTAP
Connect-NcController -Name cluster1.testlab.local -HTTPS -Credential (Get-Credential -Credential admin) | Out-Null
$failoverGroups = Get-NcNetFailoverGroup -VserverContext cluster1
$failoverGroups

FailoverGroup              Vserver                    Target
-------------              -------                    ------
Default                    cluster1                   {testc1n1:e0a, testc1n1:e0b, testc1n1:e0c, testc1n1:e0d}

Note: you might consider using the -Query -Attributes syntax to improve performance of your query. EG

 

Get-NcNetFailoverGroup -Query <NetFailoverGroupInfo> [-Attributes <NetFailoverGroupInfo>] [-VserverContext <String>] [-Controller <NcController[]>] [-ZapiRetryCount <Int32>] [<CommonParameters>]

Hope this helps?

 

/Matt

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

View solution in original post

2 REPLIES 2

mbeattie
2,326 Views

Hi,

 

Is it possible that you have connected to a data vserver instead of the cluster management vserver? Try this:

 

Import-Module DataONTAP
Connect-NcController -Name cluster1.testlab.local -HTTPS -Credential (Get-Credential -Credential admin) | Out-Null
$failoverGroups = Get-NcNetFailoverGroup -VserverContext cluster1
$failoverGroups

FailoverGroup              Vserver                    Target
-------------              -------                    ------
Default                    cluster1                   {testc1n1:e0a, testc1n1:e0b, testc1n1:e0c, testc1n1:e0d}

Note: you might consider using the -Query -Attributes syntax to improve performance of your query. EG

 

Get-NcNetFailoverGroup -Query <NetFailoverGroupInfo> [-Attributes <NetFailoverGroupInfo>] [-VserverContext <String>] [-Controller <NcController[]>] [-ZapiRetryCount <Int32>] [<CommonParameters>]

Hope this helps?

 

/Matt

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

dmeyer
2,315 Views

Thanks for your help - you catched my mistake.

 

There was indeed a "$global:currentnccontroller.Vserver = $VServer" line hidden in my script, which I thought I removed.

 

Public