PowerShell and NetApp HCI

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 forwarding 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.

Lets 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.

Hope that this helps and let me know if you have questions or comments.

Michael

=== END ===

2 thoughts on “PowerShell and NetApp HCI

  1. Hi Michael,

    Thanks you for this article.

    They have an error in your ntp server “1.us.pool.ntop.org”. It’s 1.us.pool.ntp.org

    Yannick

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.