Getting started with PowerShell management with Arista

In 2012 Microsoft Introduced (Open Management Infrastructure) OMI which allows for standard based management across different platforms. As of now Microsoft is working with Cisco and Arista to port OMI to their network switches. And also with the latest version of PowerShell DSC we can also use DSC against OMI servers running on these switches, stay tuned for more about that.

But this is a blogpost on how to get started with PowerShell management with Arista. We can download a trial from Arista’s website to run in a virtual enviroment.

After setup we need to configure a management IP and define the port parameters for the CIM session and deploy an ACL, then save the configuration.

configure
interface management 1
ip address 192.168.200.66/24

exit

management cim-provider
no shutdown
http 5985
https 5986

exit

aaa root secret Password1

ip access-list OMI
10 permit tcp 192.168.200.0/24 any eq 5985 5986

exit

control-plane
ip access-group OMI in

copy running-config startup-config

Now that the appliance is available we need to connect to it using a new-cimsession

# Since the computer does not trust the certificate we need to skipCAchecks
$nossl = New-CimSessionOption -SkipCACheck -SkipCNCheck -UseSsl

# Switch credentials
$password = ConvertTo-SecureString “Password1” -AsPlainText -Force
$credentials = New-Object System.Management.Automation.PSCredential( “root”, $password )

# Create a session to the switch
$switch = “192.168.0.10”
$session = New-CimSession -CN $switch -port 5986 -Auth Basic `
        -Credential $credentials -SessionOption $nossl

Now with WMF 5.0 we can use the included NetworkSwitchManager module to do management against the switches natively without knowning the diferent CIM classes.

For instance, we can use get-networkswitchfeature or ethernetport.

image

for instance we can define trunk ports and VLAN access

image

And as we can see from the running configuration that the parameters are set

image

Still there is alot missing from the NetworkSwitch module, hence we need to use the built-in CIM classes to do much of the management, stay tuned for more.

Leave a Reply

Scroll to Top