PowerShell

Private Cloud Automation

I want to point out a set of 4 postings by Matthew Geddes, a Hyper-V architect, on Automation and Private Cloud.

  1. Part 1: sets the stage: a number of production SQL Server instances where some nightly reporting jobs are run. These reporting jobs are quite heavyweight and impact other users during their large processing window. What we want to do is to have the reporting jobs run on non-production VMs with that day’s production data.
  2. Part 2: shows how how to use syncVM from Tintri’s PowerShell Toolkit.  Matt breaks down usage of the PowerShell cmdlet, Sync-TintriVDisk; and then shows how to integrate it into a small script.
  3. Part 3: adds more code to the small script and wraps it into a function so that it can be used for multiple reports.
  4. Part 4: adds more automation with by showing how to parameterize the reports.  Matt summarizes and gives you some homework.

I like the way Matt goes through presents the use case, and then goes through the code step by step.

Until next time,

– Rick –

Changing QoS during Veeam Backups

Tintri’s QoS is a great tool to limit storage bandwidth per VM, but what happens when a backup occurs?  Well, QoS will also limit your backup storage IOPS. If this is an issue in your environment, you might consider clearing the QoS during backup.

As an example of clearing QoS when a backup occurs,  a PowerShell script is now available that interacts with Veeam Backup and Replication.  The script, Veeam_Backup_Tintri_QoS.ps1 is available on GitHub.  The file, README.md has the information needed to run the script.

Basically the script polls the Veeam backup server every 10 seconds. When a Veeam backup job has started, the script finds the associated storage.  If the storage is on a VMstore and QoS is set, then the QoS is cleared.  After the job is done, the script restores the QoS settings.  A TGC server is required since the script connects only to a TGC.

Below is a diagram of Veeam_Backup_Tintri_QoS.ps1 (Backup Script) running in the Veeam backup server.

.veeam_tgc_diagram

However the backup script could be in a separate VM.

This script could possibly be used as a template for other backup vendors.  Results may very.  Veeam made it straight-forward with a PowerShell plug-in.

Until next time,

– Rick –

tintri_veeam_logos_small

PowerShell VM CSV Report

Greetings,

A customer via a colleague, Satinder Sharma, wanted to have a CSV output from Get-TintriVM. Their attempt was:

Get-TintriVM  | Export-Csv WS_inventory.csv

This does nothing.  After some experimentation and assistance from Dhruv Vermula, we have this:

Get-TintriVM | Select-Object {$_.vmware.name}, {$_.Uuid.UuId} | Export-csv vm2.csv

This works, but the columns are “$_.vmware.name” and “$_Uuid.Uuid”, which is not very friendly.  So I created created a small script, VmCsvReport, that is similar to a blog post “Obtain a VM CSV Report“.  This script creates nice columns; for example, “VM Name” instead of “$_.vmware.name” and creates a CSV file.

The script uses @{Expression} to create alias columns.

 $ex = @{Expression={$_.vmware.name};label="VM Name"},
       @{Expression={$_.stat.sortedstats.LatencyTotalMs};label="Total Latency"},
       @{Expression={$_.stat.sortedstats.LatencyNetworkMs};label="Network Latency"},
       @{Expression={$_.stat.sortedstats.LatencyStorageMs};label="Storage Latency"},
       @{Expression={$_.stat.sortedstats.LatencyDiskMs};label="Disk Latency"}

The output of Get-TintriVM is piped into Select-Object using the aliases in $ex.  Then $results is piped to the Export-Csv cmdlet to create a CSV file.  This could be done in one line, but I broke it up so that I could easily examine the output in debug.

$result = Get-TintriVM -TintriServer $conn | Select-Object $ex
$result | Export-Csv $csv_file

The specified VM information is in the CSV file which Excel can read quite easily.

Unfortunately, the columns are hard-coded in the script, because the PowerShell Toolkit does not have a cmdlet that maps the CSV download API.  I couldn’t suss-out a way to have configurable columns similar “Obtain a VM CSV Report“. If you know a way, please let me know.

Until next time,

– Rick –

PowerShell 2.5 Toolkit Released

Greetings,

It has been a while since I have posted. While I’ve been on vacation and catching-up, my colleague was working on a new Tintri Automation Toolkit for PowerShell 2.5. Today it went up on Tintri’s support site for your downloading pleasure. If you haven’t visited the support site in a while, you’ll notice that it has changed. Once on the support download page, find “Tintri Automation Toolkit 2.5” and click on it. An information frame will appear on the right. Click on “Download MSI” to download the new toolkit.

The major features are:
• Upgrade VMstore(s) given the RPM file
• Configure appliance settings (Data IPs, DNS, Autosupport, Alerts)
• Configure Hypervisor Managers on a VMstore
• Set Service Group QoS
• Support for SyncVM File-Level-Restore
• Manage VMstores on a TGC
• Set quota on SMB shares
• Support for PowerCLI 6

A more information is on my Tintri blog. For me, the top 3 features are: Tintri command search, setting QoS in TGC Service Groups, and updating VMstores from a downloaded RPM file.

Let me know if you have questions, or have coded new scripts you want posted on our GitHub site.

Cheers,

– Rick –

PowerShell Automation Toolkit 2.0

Greetings,

Just a quick note to inform you that the PowerShell Automation Toolkit version 2.0 is now in Tech Preview.  Tech Preview means that the toolkit is available for download and we want your feedback.  In brief, the PowerShell Toolkit 2.0 includes these features:

  1. TGC Service Groups
  2. Setting QoS policies per VM
  3. Hyper-V VM Cloning
  4. High Frequency Snapshots
  5. Deleting Snapshot Schedules
  6. SSO authentication with VMstore
  7. SyncVM

When the new GitHub code examples are available, I’ll let you know.

Regards,

– Rick –

Tintri Automation Toolkit 1.5 Released

The Tintri Automation Toolkit version 1.5 is now released.  The Automation Toolkit allows you to manage Tintri VMstore and TGC using PowerShell.  It can be obtained from Tintri Support download page under the “Download” tab, and you need a login.

The Automation Toolkit QuickStart Overview Guide can be downloaded from Tintri Support download page under the “User Guides” tab.  Scroll down to “3/2/2015 entry: “Tintri Automation Toolkit Quick Start Overview Guide”.  The guide lists all the PowerShell cmdlets, discusses how to get help and authentication, and has code samples.  See my previous PowerShell post for pictures on how to download.

The 1.5 version highlights are:

  • Hyper-V VM management
  • Delete Snapshot
  • SMB Share management
  • Support v310 Tintri API servers (as well as v300)
  • View datastore level statistics from TGC 1.1
  • On-line help improvements

Just like VMware VMs can be piped to Tintri cmdlets, so can Hyper-V VMs be piped to Tintri cmdlets.  This is what it means to be virtually aware storage.

Tintri Automation Toolkit examples are now being posted on GitHub.  Check-out the following examples that demonstrate the new features:

Over time, more PowerShell examples will be added, so check periodically.

Enjoy the new features,

– Rick –

Tintri Releases PowerShell Automation Toolkit

Greetings,

Tintri has released a PowerShell Automation Toolkit.  The toolkit works with Tintri OS 3.0.  To download it, go to Tintri’s support site, http://support.tintri.com.  You will have to log in and be a Tintri user.

Tintri download page

Tintri download page

Click on ‘Downloads in the green rectangle, and then click on ‘Download’ in the ‘Tintri Automation Toolkit 1.0″ box as noted by the purple rectangle.

A Quick Start Guide is provided.  Click on the ‘User Guides’ tab.

Tintri User Guides

Tintri User Guides

Click on the ‘Tintri Automation Toolkit Quick Start Overview Guide’.  It is PDF, and has download information, and a little more information about the PowerShell Toolkit.  A code example is in the guide.  There are more PowerShell code examples under the ‘Utilities’ tab.

Tintri Utilities Page

Tintri Utilities Page

Click on the ‘Automation Toolkit PowerShell Examples. In the zip file, you will find 13 examples ranging from cloning, replication,  snapshots, and VM monitoring.  There is an HTTP index for your convenience.  These simple examples are there to get you going and give you a feel for the Toolkit.  These examples would need to be modified to suit your environment and are for reference purposes only.

Tintri’s PowerShell cmdlets integrate with VMware’s PowerCLI to provide end-to-end VM-level automation; for example, the output of VMware PowerCLI Get-VM command can be piped to the Get-TintriVM cmdlet. This is demonstrated in the Workflow_VMMonitoring script.

Finally, check-out Luc Deken’s excellent 2-part series on Tintri’s PowerShell Toolkit at http://www.lucd.info/2014/08/14/tintri-automation-toolkit-basics-part-1/ and http://www.lucd.info/2014/08/14/tintri-automation-toolkit-basics-part-2/.

Enjoy,

– Rick –