Friday, 27 December 2013

Investigating Get-NcNetInterface

Trying to see if it is possible in the Data ONTAP PowerShell Toolkit to do the equivalent of the Clustered ONTAP CLI command:

::> network interface revert *

I compiled the following notes below. The closest I got to replicating the above was the below, and unfortunately this does not work:

$lifs = Get-NcNetInterface
foreach ($lif in $lifs){ $q = Get-NcNetInterface -template; $q.InterfaceName = $lif.InterfaceName; $a = Get-NcNetInterface -template; $a.CurrentNode = $lif.HomeNode; $a.CurrentPort = $lif.HomePort; Update-NcNetInterface -Query $q -Attributes $a }

I’m a massive fan of the Data ONTAP PowerShell Toolkit, but looks like it is missing a command like the following which would be super useful (later versions will have something like this for sure):


All the Get-NcNetInterface Attributes (Highlighted)


InterfaceName OpStatus DataProtocols FirewallPolicy Vserver Address
------------- -------- ------------- -------------- ------- -------

$ints = Get-NcNetInterface
$int = $ints[5] # 5 is just a randomly chosen LIF

InterfaceName OpStatus DataProtocols FirewallPolicy Vserver Address
------------- -------- ------------- -------------- ------- -------


Help for Get-NcNetInterface and Related Commands

Get-Help Get-NcNetInterface -Full
Get-Help New-NcNetInterface -Full
Get-Help Remove-NcNetInterface -Full
Get-Help Set-NcNetInterface -Full
Get-Help Update-NcNetInterface -Full

And Finally: An Output

Image: The closest I got to replicating “net int revert *” - report success only where the LIF was already in the right place!

Even more finally: after updating to the very latest (at the time of writing) Data ONTAP PowerShell Toolkit - - my attempt at replicating “net int revert *” in PowerShell still does not work…


  1. Maybe something like this for time being...

    $command = "net int revert *"
    Invoke-NcSsh $command