Friday, 27 December 2013

Investigating Get-NcNetInterface

Trying to see if it is possible in the Data ONTAP PowerShell Toolkit 3.0.0.90 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):

Revert-NcNetInterface

All the Get-NcNetInterface Attributes (Highlighted)

Get-NcNetInterface

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

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

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

$int.OpStatus
$int.Address
$int.AddressFamily
$int.AdministrativeStatus
$int.Comment
$int.CurrentNode
$int.CurrentPort
$int.DataProtocols
$int.DnsDomainName
$int.FailoverGroup
$int.FailoverPolicy
$int.FirewallPolicy
$int.HomeNode
$int.HomePort
$int.InterfaceName
$int.IsAutoRevert
$int.IsAutoRevertSpecified
$int.IsHome
$int.IsHomeSpecified
$int.IsIpv4LinkLocal
$int.IsIpv4LinkLocalSpecified
$int.LifUuid
$int.ListenForDnsQuery
$int.ListenForDnsQuerySpecified
$int.NcController
$int.Netmask
$int.NetmaskLength
$int.NetmaskLengthSpecified
$int.OperationalStatus
$int.Role
$int.RoutingGroupName
$int.UseFailoverGroup
$int.Vserver

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 - 3.0.1.101 - my attempt at replicating “net int revert *” in PowerShell still does not work…

2 comments:

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

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

    ReplyDelete