Setting up and using the Tintri PowerShell Toolkit

Posted by on August 20, 2014 in Storage | 0 comments

With the release of Tintri OS v3.0 the good folks at Tintri surprised us with a PowerShell Toolkit. The toolkit provides a nice list of cmdlets to get people started with automating tasks with VMstores and VMs. This immediately got my mind racing on what might be possible and how I could use them in the work lab and for customers.

To get people started I have put together a simple walk through that shows a few of the easier commands and how they might be used.

 

Install Prerequisites

You will need to have PowerShell v3.0 installed before you can install the Tintri PowerShell Toolkit. Head over to Google and locate the download, install and move to the next step.

tintri-powershell-1

Installing Tintri PowerShell Toolkit

You will need to log into the Tintri Support Portal to download the new PowerShell toolkit. The install is very straight forward, just follow the prompts and it will be done in a couple of minutes.

tintri-powershell-2

 

This step of the install is showing the license agreement, read if you want and accept and move to the next step.

tintri-powershell-3

 

This step presents the options for the installer. There are only two, install the toolkit and do you want a shortcut. Both are enabled by default.

tintri-powershell-4

 

The last step just requires you to click Install to get the process started.

tintri-powershell-5

 

Once completed you will see a confirmation shown below, click finish and you are ready to begin learning how to use the toolkit.

tintri-powershell-6

 

As a sample I am showing the start menu icon it creates below.

tintri-powershell-7

 

Getting started with Tintri Toolkit

Upon launching the Toolkit, the app will open a PowerShell window like the one shown below. Much like PowerCLI from VMware the window will open with some suggested commands to help you get started.

tintri-powershell-8

 

Before I get started with testing any commands I want to connect to my Tintri VMstore appliance. To do this I will use the Connect-TintriServer command. This is shown below, if used in this way with no switches it will prompt you for the VMstore DNS name or IP address. After that it will open a window to provide credentials to connect with.

tintri-powershell-9

 

Once it connects to the VMstore it will output details about the connection. I am showing a sample in the image below, a few bits I have blurred to not give away details about the test appliance.

tintri-powershell-10

 

List of Tintri PowerShell commands

So by now I am looking for a list of all the commands that are included as part of the Toolkit. To accomplish this I used the following command shown below.

Get-Command -Module TintriPSToolkit

There is a good amount of commands for the first version. They mostly focus around pulling details from a VMstore with a Get command. There are several that allow you to create New VMs, snapshots and replication jobs. Also available are a few Set commands for configuring replication and snapshot settings.

tintri-powershell-11

 

Get details about a VM

A simple example would be to request and display details about a single VM. To do this refer to the sample shown below and use the following command.

Get-TintriVM -name VM_NAME

If you used the same command without providing the -name switch it would display the same list but for every VM on the Tintri VMstore. That list was very long for my test as there are over 500 VMs on the appliance. But might be of value if you are using as part of a larger script or report and exporting to a file.

tintri-powershell-12

 

Create a VM Snapshot with Tintri Toolkit

Next I wanted to attempt to create a snapshot at the VMstore level not a vCenter one. This seemed like a good thing to try. The image below shows the help for the New-TintriVMSnapshot command that will be used. This should give you an idea of what the options are.

tintri-powershell-13

 

To keep things simple I’m using the command to create a snapshot for a single VM and give it a description. The description could be used for many reasons, such as tracking why it was created. The following command is what I used.

New-TintriVMSnapshot -Name VM_Name -SnapshotDescription Enter_Desc_Here

tintri-powershell-14

 

The command completed and now I wanted to see what I had created. To do this I popped back over to the Tintri manager. I am looking in the VM view and clicked on the snapshots view. Since there are a lot of VMs on this VMstore I used the search field to look for the VM name that I created the snapshot for. The image below shows the snapshot that was created and the description field shows my Test name that I entered in the PS command.

tintri-powershell-15

 

Replication setup

The following image is showing the replication command to adjust on a VM basis. I could not play with this one since I only have a single VMstore and I’m not licensed for replication. Would love to show, maybe Tintri will send another as a birthday gift and we can try some more exciting stuff. But for now look at the help details shown below to get an idea of how you might setup and control replication for a VM.

tintri-powershell-16

 

There are many more commands available than the few that I have explained here. You can use them as one-liners like I have or incorporate them into larger scripts or vCO workflows. The options are now wide open for controlling your Tintri VMstores, go forth and automate.

I already have a few ideas of more things that I want to try and hope to get a chance to do them soon. On that list would be to use some of these commands in workflows when provisioning VMs from VMware vCAC to enable features at the time of provisioning.

 

About Brian Suhr

Brian is a VCDX5-DCV and a Sr. Tech Marketing Engineer at Nutanix and owner of this website. He is active in the VMware community and helps lead the Chicago VMUG group. Specializing in VDI and Cloud project designs. Awarded VMware vExpert status 6 years for 2016 - 2011. VCP3, VCP5, VCP5-Iaas, VCP-Cloud, VCAP-DTD, VCAP5-DCD, VCAP5-DCA, VCA-DT, VCP5-DT, Cisco UCS Design

Leave a Reply

%d bloggers like this: