Menu

Getting Started with PowerShell for NetApp HCI

Michael White
204 views

I have visited a lot of customers over the years, and I know many of them are using Microsoft PowerShell to simplify their IT administration life. PowerShell makes it easier to automate and perform repetitive tasks, and many people just like using it. In fact, one of the libraries in PowerShell is a VMware scripting tool called PowerCLI, and recently it hit its millionth download.

In this blog post, I’ll show you how to get started with NetApp® HCI and PowerShell.

When I first learned that almost all the API capabilities of NetApp HCI were mirrored in PowerShell, I thought that was amazing, so I wanted to check it out. It was not hard to install, but when I tried it, I got an error.

As you can see from the error, I needed a different version of PowerShell. The minimum supported version is 6.0, but all my desktops and servers have version 5.1.

To learn how to get version 6.0 working, I read the article How to Install and Update PowerShell 6, and before you know it I had both versions of PowerShell.

So now that I had PowerShell 6 installed, I was able to install and actually use PowerShell for NetApp HCI.

To install, use this command:

Install-Module -Name SolidFire.Core

Before you can use PowerShell, you need to enter this command:

Import-Module SolidFire.Core

You must issue that command each time you use the NetApp HCI cmdlets, or you can put it in your profile. If you want to see the very long list of commands, you can use the following command:

Get-Command -Module SolidFire.Core

There are really a lot more commands than what you can see here.

Syslog log is used by many customers to move logs from where they are created to where they are used in tools like Log Insight from VMware.  The first thing you need to do is  check to see if there is a syslog destination logging server set.

First, you need to connect to the cluster:

Connect-SFCluster <FQDN or IP>

The FQDN (fully qualified domain name) or IP is for the management virtual IP address (MVIP address).

Next, query to see if a logging host has been set.

Get-SFRemoteLoggingHost

If nothing is returned, no logging host has been set. If you want to set one, issue this command, replacing a.b.c.d with your syslog destination:

Set-SFRemoteLoggingHost -RemoteHosts @{host=’a.b.c.d’;port=514}

You specify the port, but it will always use TCP.

Something to remember is that the majority of NetApp HCI cmdlets work only in the cluster and not with individual hosts.

Take a look at some interesting and useful commands and what they produce.

Check the Cluster Capacity



Get-SFClusterCapacity

Also, you can determine available space by calculating the difference between MaxProvisionedSpace and MaxUsedSpace.

Cluster Version Information



Get-SFClusterVersionInfo

Check Network Time Protocol (NTP) Information



Get-SFNTPInfo

Set NTP Information



Set-SFNTPInfo

Now you know how to get started with PowerShell and your NetApp HCI system. Using PowerShell, you can do practically anything that you can do in the UI, so you should check it out.

For more information, see the user guide and release notes.

Michael White

After leaving the military, Michael started out in professional services for a VMware partner. After doing technical implementations around the world, he joined VMware. Michael started as a partner SE, followed by specialist SE, then staff technical marketing architect, and finally moved into R&D as an integration architect. Much of his career has been in BCDR-related work. After a couple of years in product management and alliances at DataGravity, Michael moved to Veeam, first in technical marketing, and then in product management. Michael has spoken on a variety of topics at TSX, PEX, VMworld, Gartner, and local VMUGs. Michael recently started at NetApp in technical marketing for NetApp HCI.

View all Posts by Michael White

Next Steps

Drift chat loading