Home > Tintri VMstore™ > Knowledge Base > How to use Tintri REST API or Powershell cmdlets to read performance stats from a VMstore or TGC

How to use Tintri REST API or Powershell cmdlets to read performance stats from a VMstore or TGC

Applies To

 

Product(s)

Version(s)

REST API

v310

Tintri Automation Toolkit v3.0
VMstore TxOS 4.2+
TGC TGC 3.0+

Description

This article describes how to read performance stats live from a VMstore or from TGC using either REST API or Powershell cmdlets from the Tintri Automation Toolkit.

 

How-To

Powershell

First create a session that you can use for authenticating commands:

$ts = Connect-TintriServer <vmstore_hostname/IP> admin <password>

 

You can then use that session to authenticate further powershell commands.

 

The "Get-TintriDatastoreStat" cmdlet will return the current summary slice (historic, 10 minutes, limited to one slice), a realtime slice or historic slices (all of the stats, this gets very big). Below I look at the realtime stats only:

Get-TintriDatastoreStat -TintriServer $ts -StatsType Realtime

 

ApplianceHostName                                  : cstb301.tintrics.tintri.com

ApplianceUuid                                      : 0109-1432-959-PLT-000000000000000000000000000000000000000

TimeStart                                          : 2017-03-03T05:45:36.740-08:00

TimeEnd                                            : 2017-03-03T05:45:36.740-08:00

IntervalSeconds                                    : 0

OperationsReadIops                                 : 0

OperationsWriteIops                                : 0

ThroughputReadMBps                                 : 0

ThroughputWriteMBps                                : 0

LatencyHostMs                                      : 0

LatencyNetworkMs                                   : 0

LatencyStorageMs                                   : 0

LatencyDiskMs                                      : 0

LatencyTotalMs                                     : 0

PerformanceReserveAutoAllocated                    : 17.06

PerformanceReservePinned                           : 1.41

PerformanceReserveActual                           : 0

PerformanceReserveChange                           : 0

PerformanceReserveChangePercent                    : 0

ThroughputCacheReadMBps                            : 0

FlashHitPercent                                    : 100

ThroughputFlashMissMBps                            : 0

SpaceUsedLiveGiB                                   : 12957.6428882629

SpaceUsedSnapshotsTintriGiB                        : 6182.58503509127

SpaceUsedSnapshotsHypervisorGiB                    : 319.131989741698

SpaceUsedSnapshotsHypervisorPhysicalGiB            : 170.618946606293

SpaceUsedChangeGiB                                 : 0

SpaceUsedChangePhysicalGiB                         : 0

SpaceUsedChangePercent                             : 0

SpaceUsedPhysicalChangePercent                     : 0

SpaceUsedGiB                                       : 19471.2619458027

SpaceUsedPhysicalGiB                               : 14816.7056476958

CloneDedupeFactor                                  : 1.06577103660482

CompressionFactor                                  : 1.3141424557375

SpaceUsedLivePhysicalGiB                           : 9750.67528568208

SpaceUsedSnapshotsTintriPhysicalGiB                : 4841.16999063455

SpaceUsedOtherGiB                                  : 331.034022448584

SpaceUsedOtherPhysicalGiB                          : 224.860371379182

ReplicationIncoming.ThroughputIncomingLogicalMBps  : 0

ReplicationIncoming.ThroughputIncomingPhysicalMBps : 0

ReplicationOutgoing.ThroughputLogicalMBps          : 0

ReplicationOutgoing.ThroughputPhysicalMBps         : 0

ReplicationOutgoing.BytesRemainingMB               : 0

 

REST API

 

First connect to the vmstore using curl to send API requests over the command line:

curl -k -i -X POST -H 'Content-Type: application/json' -d '{"username":"admin", "typeId":"com.tintri.api.rest.vcommon.dto.rbac.RestApiCredentials", "password":"<PASSWORD>"}' https://<vmstore_hostname/IP>/api/v310/session/login > cookie.txt

 

(Note: the '-k' option in curl ignores certificate errors, onyl use this if you do not have a valid signed certificate on the VMstore)

 

You can then use that cookie session to authenticate further API requests:

curl -k -i -X GET -H 'Content-Type: application/json' -b cookie.txt -d 'DatastoreResource.getLatestTrendData({"uuid": "default"});' https://<vmstore_hostname/IP>/api/v310/datastore/default/statsRealtime

 

The output is returned in JSON format. You can parse this information through any JSON converter to get a readable output like below:

{

       "typeId": "com.tintri.api.rest.v310.dto.Page",

       "completedIn": 11,

       "lastUpdatedTime": "2017-03-03T13:53:01.896Z",

       "absoluteTotal": 1,

       "items": [{

                     "typeId": "com.tintri.api.rest.v310.dto.domain.beans.perf.Stats",

                     "startTime": "2017-03-03T13:52:57.081Z",

                     "endTime": "2017-03-03T13:52:57.081Z",

                     "sortedStats": [{

                                  "typeId": "com.tintri.api.rest.v310.dto.domain.beans.perf.DatastoreStat",

                                  "timeStart": "2017-03-03T13:52:57.081Z",

                                  "timeEnd": "2017-03-03T13:52:57.081Z",

                                  "intervalSeconds": 0,

                                  "operationsReadIops": 8041,

                                  "operationsWriteIops": 375,

                                  "normalizedTotalIops": 10596,

                                  "throughputReadMBps": 66.78,

                                  "throughputWriteMBps": 19.48,

                                  "latencyHostMs": 0.1,

                                  "latencyNetworkMs": 0.1,

                                  "latencyStorageMs": 0.4,

                                  "latencyDiskMs": 0.0,

                                  "latencyContentionMs": 0.0,

                                  "latencyThrottleMs": 0.0,

                                  "latencyFlashMs": 0.4,

                                  "latencyTotalMs": 0.6,

                                  "performanceReserveAutoAllocated": 36.24,

                                  "performanceReservePinned": 0.0,

                                  "throughputCacheReadMBps": 66.7,

                                  "flashHitPercent": 99.89,

                                  "throughputFlashMissMBps": 98499.69715507605,

                                  "spaceUsedLiveGiB": 4101.444396972656,

                                  "spaceUsedSnapshotsTintriGiB": 1452.0077514648438,

                                  "spaceUsedSnapshotsHypervisorGiB": 18.697509765625,

                                  "spaceUsedSnapshotsHypervisorPhysicalGiB": 18.697509765625,

                                  "spaceUsedChangeGiB": 0.0,

                                   "spaceUsedChangePhysicalGiB": 0.0,

                                  "spaceUsedChangePercent": 0.0,

                                  "spaceUsedPhysicalChangePercent": 0.0,

                                  "spaceUsedGiB": 5769.6453857421875,

                                  "spaceUsedPhysicalGiB": 5769.6453857421875,

                                  "cloneDedupeFactor": 1.0,

                                  "compressionFactor": 1.0,

                                  "spaceSavingsFactor": 1.0,

                                  "spaceUsedLivePhysicalGiB": 4101.444396972656,

                                  "spaceUsedSnapshotsTintriPhysicalGiB": 1452.0077514648438,

                                  "latencyMirrorMs": 0.0,

                                  "latencyMirrorReadMs": 0.0,

                                  "latencyMirrorWriteMs": 0.3,

                                  "latencyMirrorWriteNetworkMs": 0.3,

                                  "spaceUsedOtherGiB": 216.1932373046875,

                                  "spaceUsedMappedGiB": 5769.6453857421875,

                                  "spaceUsedOtherPhysicalGiB": 216.1932373046875,

                                  "replicationIncoming": {

                                         "typeId": "com.tintri.api.rest.v310.dto.domain.beans.perf.ReplicationStat",

                                         "throughputIncomingLogicalMBps": 0.0,

                                         "throughputIncomingPhysicalMBps": 0.0

                                  },

                                  "replicationOutgoing": {

                                         "typeId": "com.tintri.api.rest.v310.dto.domain.beans.perf.ReplicationStat",

                                         "throughputLogicalMBps": 0.0,

                                         "throughputPhysicalMBps": 0.0,

                                         "bytesRemainingMB": 0.0

                                  },

                                  "dedupeFactor": 1.0,

                                  "logicalUniqueSpaceUsedGiB": 5769.6453857421875,

                                  "migration": {

                                         "typeId": "com.tintri.api.rest.v310.dto.domain.beans.perf.MigrationStat",

                                         "migrationThroughputOutgoingLogicalMBps": 0.0,

                                         "migrationThroughputOutgoingPhysicalMBps": 0.0,

                                         "migrationOutgoingDataRemainingMB": 0.0

                                  },

                                  "operationsTotalIops": 8416,

                                  "throughputTotalMBps": 86.26,

                                  "latencyIopsPercent": 0.84,

                                  "inactive": false,

                                  "performanceReserveUsed": 36.24,

                                  "performanceReserveRemaining": 63.76,

                                  "requestSizeKiB": 10.009301479325098

                           }

                     ],

                     "lastUpdatedTime": "2017-03-03T13:52:57.081Z",

                     "numberOfSlices": 1

              }

       ],

       "limit": 2000,

       "offset": 0,

       "overflow": false,

       "filteredTotal": 1,

       "total": 1,

       "offsetMatchFound": true,

       "page": 1,

       "pageTotal": 1

}

 

Getting VMstore stats from TGC

Use the method described above to request a JSESSIONID and store it in a text file for authentication.

 

You will need to get the VMstore UUID to request stats for that VMstore from TGC:

curl -k -i -X GET -H 'Content-Type: application/json' -b cookie.txt -d 'DatastoreResource.getDatastores({});' https://<tgc_hostname/IP>/api/v310/datastore

 

This will give you some JSON output, the section you are looking for will look like:

            "uuid": {
                "typeId": "com.tintri.api.rest.vcommon.dto.Uuid",
                "uuid": "TIN-79362567-ecc1-4245-a1d7-e693c143c936"
            },

 

Then use this UUID when issuing the API request against the TGC:

curl -k -i -X GET -H 'Content-Type: application/json' -b cookie.txt -d 'DatastoreResource.getLatestTrendData({"uuid": "TIN-79362567-ecc1-4245-a1d7-e693c143c936"});' https://<tgc_hostname/IP>/api/v310/datastore/TIN-79362567-ecc1-4245-a1d7-e693c143c936/statsRealtime

  

Viewing 1 of 1 comments: view all
Approved - RD - 14/03/2017 Edited 05:17, 14 Mar 2017
Posted 05:16, 14 Mar 2017
Viewing 1 of 1 comments: view all
You must to post a comment.
Last modified
10:54, 22 Apr 2017

Tags

Classifications

This page has no classifications.