Every Tintri VMstore ships with a REST API that can do almost everything the UI does, and most vSphere teams only ever use it for one dashboard. The reasons are always the same: the login is not the vCenter login, the session is a cookie rather than a token header, every update needs a typeId nobody remembers, and the VM the VMstore calls …-VIM-0000000000000024 has to be matched to a vCenter MoRef before anyone trusts an automated action against it. This guide fixes that. It walks the API in the order you actually use it, from login to appliance health, datastore and VM statistics, snapshots, per-VM QoS, SyncVM and clones, replication and alerts, and shows how to tie each VMstore VM to its vCenter identity through the vSphere Automation API. Every call is shown as raw HTTP, curl and PowerShell, and the whole thing is packaged as a Postman collection you can run with newman as a smoke test.

Level: intermediate to advanced  ·  Stack: Tintri VMstore (TxOS 6.0.x, REST API v310.207), vSphere 8 / VCF 9 vCenter (Automation API 9.x), Postman, newman 6.x, PowerShell 7, curl, Python 3  ·  Build time: about 60 minutes to a green newman run


Contents

  1. Scope, versions and what was checked
  2. Architecture: who calls whom
  3. API basics: versions, roles, paging, typeId
  4. Authentication and the session lifecycle
  5. Discover: appliance, controllers, datastore, vCenter registration
  6. VMs and statistics
  7. Mapping a VMstore VM to its vCenter identity
  8. Snapshots: create, list, delete
  9. Per-VM QoS by API
  10. SyncVM, clones and task polling
  11. Replication and alerts
  12. Packet flow: the network under the API
  13. The Postman collection and newman
  14. End-to-end workflow
  15. API reference table
  16. Error shapes and what they mean
  17. Troubleshooting
  18. What’s next

01. Scope, versions and what was checked

This is the API companion to part 3 of the VMware, Tintri and Cisco series, which covers the design side: networks, vCenter registration, mounts, VAAI, QoS and protection policy. Here the same objects are driven by API. The vCenter side of a deployment (datacenter, cluster, hosts, vLCM image, the NFS mount gap in the REST API) is in the vSphere Automation REST API deploy guide, and fleet scope through Tintri Global Center is in the TGC API guide.

Checked against: the public Tintri REST API reference published on GitHub at tintri.github.io/tintri-rest-api, documentation version v310.207, which maps to TxOS 6.0.3 (the repository was last updated in October 2026), cross-checked against the DTO reference and the example scripts in the public Tintri/tintri-api-examples and Tintri/tintri-python-sdk repositories. The vCenter calls were checked against the vSphere Automation API reference on developer.broadcom.com at /latest/, which is vSphere Automation API 9.1.2 as of December 2026; every call used here is also in the 9.0 reference. Nothing newer than v310 exists as an API family: Tintri versions the API as v310.<minor>, and the paths stay under /api/v310/.

API versionTxOSTGCWhat it added that this guide uses
v310.1014.6.0.x5.0.0The floor: from TxOS and TGC 5.6.0.1 onward, versions below v310.101 are deprecated
v310.1715.4.25.5.xGET /datastore/{uuid}/hypervisorManagerConfig/{managerId}?refresh=
v310.1835.5.2.x5.5.4.xSnapshot lock and unlock, data protection config
v310.1915.6.05.6.0GET /alert/paginated, IPv6 (needs fullApiVersion v310.191 or later at login), TLS 1.2 only from 5.6.0.1
v310.201 / .203 / .2056.0.0 / 6.0.1 / 6.0.2sameNo new endpoints listed publicly
v310.2076.0.3n/aPUT /servicegroup/{id}/mountIp

Where a field or behaviour could not be confirmed from those public sources, the text says “check against the API reference for your TxOS version”. If you run TxOS older than 5.6, everything here works except the calls marked v310.191 and later in the reference table; the version matrix above tells you which to drop.

02. Architecture: who calls whom

Three things talk HTTPS in this design, and it is worth being precise about which, because firewall tickets and certificate trust both follow from it. Your workstation or CI runner calls the VMstore admin IP and vCenter. The VMstore itself calls vCenter, using the service account you registered on it, to resolve files into VMs and to request vSphere snapshots for VM-consistent protection. The API never touches the data network: NFS stays on the storage VLAN between the ESXi VMkernel port and the VMstore data IP.

Admin workstation Postman, newman, PowerShell 7 10.0.10.50, mgmt VLAN 10 or a CI runner vcenter01.lab.local Automation API /api (9.x) 10.0.10.10, VLAN 10 tgc01.lab.local (optional) Tintri Global Center API fleet scope, see post 23 443 HTTPS 443 to VMstore admin IP: /api/v310/… Nexus 9000 vPC pair VLANs 10, 20, 30, 40 trunked; system MTU 9216 UCS FI A (fabric A) appliance port to VMstore UCS FI B (fabric B) appliance port to VMstore uplink port-channels ESXi hosts esx01 to esx04 (UCS, VIC) vmk0 mgmt VLAN 10 10.0.10.21 MTU 1500 vmk1 vMotion VLAN 20 10.0.20.21 MTU 9000 vmk2 NFS VLAN 30 10.0.30.21 MTU 9000 vDS port group pg-nfs-30: vNIC A active, vNIC B standby datastore vmstore01-ds = 10.0.30.50:/tintri VAAI-NAS plugin on every host vNIC A vNIC B standby vmstore01.lab.local (Tintri VMstore) Controller A: ACTIVE owns admin and data IPs Controller B: STANDBY takes over on failover admin 10.0.10.40 VLAN 10 REST API 443; calls vCenter 443 data 10.0.30.50 VLAN 30 NFSv3, MTU 9000 replication 10.0.40.50 VLAN 40 datastore id in the API: “default” data port A data port B admin + replication links mgmt VLAN 10 VLAN 40 to DR VMstore (ReplicateVM) NFS data path control / API (HTTPS) standby path replication uplinks all values are examples
Figure 1. Components, networks and API paths. Example VLANs: 10 management, 20 vMotion, 30 NFS, 40 replication. The REST API is served on the VMstore admin interface only.
  • VMstore REST API: https://<admin FQDN>/api/v310/... on the admin interface. Tintri’s reference states that all requests must use SSL, and that a request to port 80 is converted to 443.
  • vCenter Automation API: https://<vcenter>/api/.... Used here for the session and for VM identity.
  • One VMstore, one datastore: a VMstore presents a single datastore, and the API accepts the literal default as both the appliance and the datastore identifier. Every path below uses it.
  • Service accounts: one VMstore account for automation (role decided in section 03) and one vCenter account with read access for the identity lookup. Keep them separate from the account the VMstore uses to talk to vCenter.

03. API basics: versions, roles, paging, typeId

Discover what the box speaks

GET /api/info needs no authentication and returns a RestApi object: productName, preferredVersion and supportedVersionSet. Call it first in every script. It tells you the VMstore is reachable, the certificate chain works, and which versions it accepts.

GET /api/info HTTP/1.1
Host: vmstore01.lab.local
Accept: application/json

HTTP/1.1 200 OK
Content-Type: application/json
{
  "typeId": "com.tintri.api.rest.v.dto.domain.RestApi",
  "productName": "Tintri VMstore",
  "preferredVersion": "v310.207",
  "supportedVersionSet": ["v310.207", "..."]
}

The response above is trimmed and illustrative; the exact strings in productName and supportedVersionSet depend on the build, so print them once on yours rather than parsing them blindly.

fullApiVersion decides the behaviour you get

The login body carries an optional fullApiVersion. Tintri’s reference is explicit that if you leave it out, the server uses v310.1. That is the oldest behaviour the API has. Send the version your TxOS supports (v310.207 for 6.0.3) so you get current semantics, IPv6 support and current response shapes. Treat it like a pinned dependency: change it when you upgrade TxOS, test, then commit.

Roles: give automation the least it needs

RoleReadWriteUser mgmtLock snapshotUse it for
Read OnlyYesNoNoNoMonitoring, reports, the Discover/Verify/Troubleshoot folders, newman smoke tests
System AdminYesYesNoNoAutomation that takes snapshots, sets QoS, clones
Data Protection AdminYesYesNoYesPipelines that manage locked snapshots and protection policy
AdminYesYesYesNoPeople, not scripts

The table is from the RBAC section of Tintri’s REST reference (DBA and Data Protection Escalation Admin are also listed there). A Read Only account can call every GET; that is all the smoke test needs. Give the write-capable account to the pipeline, not to every engineer’s Postman.

Paging, filters and the two update envelopes

  • Paging. List calls return a Page: items, filteredTotal, total, absoluteTotal, limit (default 2000), offset, page, pageTotal, and next/prev as ready-made query strings. Loop on next, as Tintri’s own get_vms_paged.py does, rather than computing offsets yourself.
  • Filters. Query parameters follow RFC 6570, for example /v310/vm?name=app01&live=TRUE or /v310/snapshot?vmUuid=<uuid>&type=USER_GENERATED_SNAPSHOT. Each list call documents its filter spec (VirtualMachineFilterSpec, SnapshotFilterSpec, AlertFilterSpec).
  • typeId. Every JSON object you send carries a typeId naming its DTO class. Missing or wrong typeIds are the most common cause of a 400.
  • Request (com.tintri.api.rest.v310.dto.Request) updates named properties on one or more objects: objectsWithNewValues plus propertiesToBeUpdated. Only the listed properties change.
  • MultipleSelectionRequest (com.tintri.api.rest.v310.dto.MultipleSelectionRequest) applies one newValue to many IDs: ids, newValue, propertyNames. This is the bulk form, for example QoS on fifty VMs in one call.

04. Authentication and the session lifecycle

newman / script Postman runner, PowerShell VMstore REST API vmstore01: /api/v310 vCenter Automation API vcenter01: /api 1 GET /api/info (no auth) 200 RestApi: supportedVersionSet 2 POST /api/v310/session/login 200 + Set-Cookie: JSESSIONID session handoff cookie saved as {{tintriSession}} 3 GET /v310/appliance/default/operationalStatus isFilesystemUp: true 4 GET /v310/vm?name=app01&live=TRUE uuid.uuid, vmware.mor, instanceUuids 5 POST /api/session (HTTP Basic) 200 “<session token>” token handoff header vmware-api-session-id: {{vcSession}} 6 GET /api/vcenter/vm/{vm} ({vm} = vmware.mor) identity.instance_uuid: match or stop 7 POST /v310/snapshot [SnapshotSpec] [“…-SST-…”] 8 POST /v310/vm (VirtualMachineCloneSpec) Task: uuid, state QUEUED loop every 5 s until jobDone (max N tries) 9 GET /v310/task/{id} RUNNING | SUCCESS | FAILED 10 POST /v310/session/logout 204 11 DELETE /api/session 204 401 on any call session expired or invalidated: run step 2 again, retry once 409 Conflict object already exists: GET it, do not create it again Task state FAILED read task.error (TintriError), stop and raise an alert request (HTTPS 443) response session handoff failure branch paths relative to https://host
Figure 2. The API sequence used by the Postman collection and the scripts: session handoffs in green, task polling loop in blue, failure branches in amber.

Log in

A VMstore login is a POST of a RestApiCredentials object. The response body is the role name as a string, and the session is the JSESSIONID cookie. Every later call sends that cookie. There is no bearer token.

POST /api/v310/session/login HTTP/1.1
Host: vmstore01.lab.local
Content-Type: application/json
Accept: application/json

{
  "typeId": "com.tintri.api.rest.vcommon.dto.rbac.RestApiCredentials",
  "username": "svc-vmstore-api",
  "password": "<from your vault>",
  "fullApiVersion": "v310.207"
}

HTTP/1.1 200 OK
Set-Cookie: JSESSIONID=<opaque>; Path=/api; Secure; HttpOnly
Content-Type: application/json

"SYSTEM_ADMIN"

The body string shown is illustrative; it is the role name of the account. Cookie attributes vary by build. What matters is that you capture JSESSIONID and send it back.

curl

#!/usr/bin/env bash
# vmstore-session.sh: log in, show the session, log out. Needs curl and jq.
# Secrets: TINTRI_USER, TINTRI_PASSWORD. Optional: TINTRI_CA (PEM bundle that signs the VMstore cert).
set -euo pipefail
VMSTORE="${VMSTORE:-vmstore01.lab.local}"
API_VERSION="${API_VERSION:-v310.207}"
JAR=$(mktemp); trap 'rm -f "$JAR"' EXIT
CURL=(curl -sS --fail-with-body --max-time 60 -b "$JAR" -c "$JAR" -H 'Accept: application/json')
[ -n "${TINTRI_CA:-}" ] && CURL+=(--cacert "$TINTRI_CA")

"${CURL[@]}" "https://$VMSTORE/api/info" | jq '{productName, preferredVersion}'

jq -n --arg u "$TINTRI_USER" --arg p "$TINTRI_PASSWORD" --arg v "$API_VERSION" \
  '{typeId:"com.tintri.api.rest.vcommon.dto.rbac.RestApiCredentials", username:$u, password:$p, fullApiVersion:$v}' |
  "${CURL[@]}" -H 'Content-Type: application/json' -X POST --data @- \
  "https://$VMSTORE/api/v310/session/login"; echo

"${CURL[@]}" "https://$VMSTORE/api/v310/session/current" | jq '{userName, roles, loginTime, expirationTime}'

"${CURL[@]}" -X POST "https://$VMSTORE/api/v310/session/logout" -o /dev/null -w 'logout HTTP %{http_code}\n'

PowerShell 7

# Connect-VMstore.ps1: returns a WebRequestSession holding JSESSIONID. PowerShell 7.2+.
# Secrets come from the environment: TINTRI_USER, TINTRI_PASSWORD.
param(
  [string]$VMstore = 'vmstore01.lab.local',
  [string]$ApiVersion = 'v310.207'
)
$ErrorActionPreference = 'Stop'
$base = "https://$VMstore/api"
$info = Invoke-RestMethod -Uri "$base/info" -Method Get
Write-Host "API: $($info.productName) preferred $($info.preferredVersion)"

$body = @{
  typeId         = 'com.tintri.api.rest.vcommon.dto.rbac.RestApiCredentials'
  username       = $env:TINTRI_USER
  password       = $env:TINTRI_PASSWORD
  fullApiVersion = $ApiVersion
} | ConvertTo-Json
$role = Invoke-RestMethod -Uri "$base/v310/session/login" -Method Post -Body $body `
          -ContentType 'application/json' -SessionVariable tintri
Write-Host "Logged in as $env:TINTRI_USER, role $role"

$cur = Invoke-RestMethod -Uri "$base/v310/session/current" -WebSession $tintri
Write-Host "Session expires $($cur.expirationTime)"
# ... your calls here, always with -WebSession $tintri ...
Invoke-RestMethod -Uri "$base/v310/session/logout" -Method Post -WebSession $tintri | Out-Null

If the VMstore certificate is not signed by a CA your machine trusts, fix the trust (import the issuing CA) rather than adding -SkipCertificateCheck to production scripts. In a lab, -SkipCertificateCheck on each Invoke-RestMethod is the PowerShell 7 equivalent of curl -k.

Session lifetime, inspection and logout

  • How long it lives. The public reference does not state a fixed timeout. GET /v310/session/current (since v310.51) returns your UserSession with loginTime, lastAccessedTime and expirationTime; read the expiry from there and log in again on the first 401 rather than guessing.
  • Who else is logged in. GET /v310/session/active (since v310.51) lists sessions with userName, clientIp and clientType. An Admin can end one with POST /v310/session/{tintriSessionId}/invalidate (since v310.71); the id there is a Tintri session ID, not the JSESSIONID.
  • Log out with POST. POST /v310/session/logout is the current call and returns 204. GET /v310/session/logout still exists but is marked deprecated in v310.207. Older scripts, including some public examples, use the GET; change them.
  • Always log out. Scripts that log in every five minutes and never log out leave a trail of idle sessions in session/active, and that is where you will look first when someone asks why the API “feels slow”.

The vCenter side

vCenter uses a token, not a cookie. POST /api/session with HTTP Basic credentials returns the token as a JSON string; send it as the vmware-api-session-id header and end it with DELETE /api/session (204). If you have old scripts on /rest/com/vmware/cis/session, that is the legacy path: the replacement is /api/session, and post 21 covers the rest of the migration.

# curl: vCenter session, VM lookup, logout. Secrets: VC_USER, VC_PASSWORD.
VC=vcenter01.lab.local
TOKEN=$(curl -sS --fail-with-body -X POST -u "$VC_USER:$VC_PASSWORD" "https://$VC/api/session" | jq -r .)
curl -sS -H "vmware-api-session-id: $TOKEN" "https://$VC/api/vcenter/vm?names=app01" | jq .
curl -sS -X DELETE -H "vmware-api-session-id: $TOKEN" "https://$VC/api/session" -o /dev/null -w '%{http_code}\n'

05. Discover: appliance, controllers, datastore, vCenter registration

These are the read-only calls that answer “is this VMstore healthy and wired to the right vCenter” before you change anything. All of them work with a Read Only account.

CallWhat to look atBad looks like
GET /v310/appliance/default/infomodelName, osVersion, isAllFlash, currentCapacityGiBTxOS version differs from what your interop sheet says
GET /v310/appliance/default/operationalStatusisFilesystemUp, urgentMessage, alertsUnreadCount, restartFlag, uptimeisFilesystemUp: false; any urgentMessage; restartFlag other than NO_RESTART_REQUIRED
GET /v310/appliance/default/controllerone role: ACTIVE, one STANDBY, same osVersionA controller in UNAVAILABLE or REMOVED (UNAVAILABLE exists since v310.121)
GET /v310/appliance/default/failedComponentsemptyAny entry: a hardware case
GET /v310/datastore/default/hypervisorManagerConfigentries with hypervisorType: VMWARE, host, usernameNo VMware entry: VM names, VM-consistent snapshots and clones into vCenter will not work
GET /v310/datastore/default/statsSummaryspaceUsedPhysicalGiB, spaceTotalGiB, spaceRemainingDays, latencyTotalMs, operationsTotalIops, vmsCountspaceRemainingDays below your procurement lead time
GET /api/v310/appliance/default/operationalStatus HTTP/1.1
Host: vmstore01.lab.local
Cookie: JSESSIONID=<opaque>
Accept: application/json

HTTP/1.1 200 OK
{
  "typeId": "com.tintri.api.rest.v310.dto.domain.beans.hardware.ApplianceOperationalInfo",
  "isFilesystemUp": true,
  "alertsUnreadCount": 3,
  "restartFlag": "NO_RESTART_REQUIRED",
  "uptime": "41 days 6 hours 12 minutes",
  "urgentMessage": null,
  "nfsTotalConnectionCount": 48
}
# PowerShell, continuing with $tintri and $base from Connect-VMstore.ps1
$op   = Invoke-RestMethod "$base/v310/appliance/default/operationalStatus" -WebSession $tintri
$ctl  = @(Invoke-RestMethod "$base/v310/appliance/default/controller" -WebSession $tintri)
$hv   = @(Invoke-RestMethod "$base/v310/datastore/default/hypervisorManagerConfig" -WebSession $tintri)
$ds   = Invoke-RestMethod "$base/v310/datastore/default/statsSummary" -WebSession $tintri
[pscustomobject]@{
  FilesystemUp  = $op.isFilesystemUp
  Controllers   = ($ctl | ForEach-Object { "$($_.locator)=$($_.role)" }) -join ', '
  vCenters      = ($hv | Where-Object hypervisorType -eq 'VMWARE' | ForEach-Object host) -join ', '
  UsedGiB       = [math]::Round($ds.spaceUsedPhysicalGiB, 0)
  TotalGiB      = [math]::Round($ds.spaceTotalGiB, 0)
  DaysLeft      = $ds.spaceRemainingDays
} | Format-List

Registering vCenter by API is possible with POST /v310/datastore/default/hypervisorManagerConfig (a list of HypervisorManagerConfig with hypervisorType, host, username and password; only the username and password can be edited afterwards, with PUT .../hypervisorManagerConfig/{managerConfigId}). I still do the first registration in the UI, because it is a one-off and the UI shows the certificate it is about to trust. Rotating the password is where the API earns its keep: put the PUT in the same pipeline that rotates the vCenter account. To check the registration without forcing a refresh, use GET .../hypervisorManagerConfig/{managerId}?refresh=false (since v310.171); refresh=true blocks until the VMstore has re-read vCenter, so do not put it in a tight loop.

06. VMs and statistics

GET /v310/vm returns a page of VirtualMachine objects. Each carries uuid.uuid (the Tintri VM UUID, the ID every other VM call takes), a vmware block with the hypervisor view, qosConfig, snapshot, replication, serviceGroup, and stat with the latest statistics slice. Filter by name and live=TRUE so deleted VMs, which the VMstore remembers for a while, do not match.

GET /api/v310/vm?name=app01&live=TRUE&limit=10 HTTP/1.1
Host: vmstore01.lab.local
Cookie: JSESSIONID=<opaque>

HTTP/1.1 200 OK
{
  "typeId": "com.tintri.api.rest.v310.dto.Page",
  "filteredTotal": 1, "total": 412, "limit": 10, "page": 1, "pageTotal": 1,
  "items": [{
    "typeId": "com.tintri.api.rest.v310.dto.domain.VirtualMachine",
    "uuid": { "uuid": "A1D88A8A-8904-1E35-9DC2-589C317D31A6-VIM-0000000000000070" },
    "isLive": true,
    "provisionedType": "THIN",
    "vmware": {
      "name": "app01", "mor": "<hypervisor-assigned id>",
      "instanceUuids": ["5003a1b2-...."], "biosUuid": "4203c4d5-....",
      "vcenterName": "vcenter01.lab.local", "host": "esx02.lab.local", "isPowered": true
    },
    "qosConfig": { "minNormalizedIops": 0, "maxNormalizedIops": 0 },
    "stat": { "sortedStats": [ { "latencyTotalMs": 1.4, "operationsTotalIops": 820 } ] }
  }]
}
# curl, after the login in vmstore-session.sh (reuse "${CURL[@]}" and $VMSTORE)
"${CURL[@]}" "https://$VMSTORE/api/v310/vm?name=app01&live=TRUE" |
  jq '.items[] | {uuid: .uuid.uuid, name: .vmware.name, mor: .vmware.mor,
                  instanceUuids: .vmware.instanceUuids, vcenter: .vmware.vcenterName}'

# every live VM, paging on .next
url="https://$VMSTORE/api/v310/vm?live=TRUE&limit=500"
while :; do
  page=$("${CURL[@]}" "$url")
  echo "$page" | jq -r '.items[] | [.uuid.uuid, .vmware.name] | @tsv'
  next=$(echo "$page" | jq -r '.next // empty')
  [ -z "$next" ] && break
  url="https://$VMSTORE/api/v310/vm?$next"
done

Which statistics call

CallReturnsUse it for
GET /v310/vm (field stat)Latest slice per VM, in the listFleet-wide top-N tables in one call
GET /v310/vm/{vmId}/statsRealtimeReal-time slices for one VM (VMstore only)Watching one VM during an incident
GET /v310/vm/{vmId}/statsHistoricHistoric slices for one VM, filterable by timeBefore/after comparisons, change reviews
GET /v310/datastore/default/statsRealtime, statsHistoric, statsSummaryThe same for the whole VMstoreCapacity and headroom

Stats arrive as a Stats object whose sortedStats collection is, per the DTO description, sorted from start time to end time, so the last element is the newest. The latency split you care about is on each slice: latencyHostMs, latencyNetworkMs, latencyStorageMs, latencyContentionMs (QoS contention), latencyThrottleMs (QoS throttling), and latencyTotalMs. Part 5 of the series explains how to read the split during an incident; the per-VM latency post has the full PowerShell and Python reporter, so I will not repeat it here.

07. Mapping a VMstore VM to its vCenter identity

Before any automation changes a VM it found on the VMstore, it should prove that VM is the one vCenter thinks it is. Names are not identities: two clusters can each have an app01, a VM can be renamed in vCenter between two polls, and a restored or cloned VM can carry the same name as the original. The VMstore gives you three hypervisor-side identifiers in the vmware block of every VM, and vCenter gives you the matching ones.

VMstore field (VirtualMachineVmwareInfo)Tintri descriptionvCenter equivalentHow to use it
vmware.morThe hypervisor assigned ID of the VMvm in GET /api/vcenter/vm (the MoRef value, for example vm-1042)Direct lookup key: GET /api/vcenter/vm/{vm}. Unique per vCenter only
vmware.instanceUuids (list)The list of UUIDs assigned to the VM by the owning hypervisoridentity.instance_uuid in GET /api/vcenter/vm/{vm}The proof: must match before you act
vmware.biosUuidBIOS UUID as reported by the hypervisoridentity.bios_uuidSecondary check; clones can share it
vmware.vcenterNameThe hypervisor manager nameThe vCenter you are logged in toPick the right vCenter when the VMstore serves several

identity on GET /api/vcenter/vm/{vm} has been in the Automation API since vSphere API 6.7.1, so it is there on every vSphere 8 and 9 vCenter. The list call GET /api/vcenter/vm filters by names, hosts, clusters, datastores, folders, power_states and returns vm, name, power_state, cpu_count, memory_size_mib; it refuses to return more than 4000 VMs (HTTP 500 above that), so filter by cluster on big vCenters. The exact string format of vmware.mor on your TxOS build is the one thing to check before you trust the join: dump one VM and compare it with the vm value vCenter returns for the same machine.

<#
.SYNOPSIS
  Get-VMstoreVmMap.ps1: map every live VM on a Tintri VMstore to its vCenter identity and flag mismatches.
.NOTES
  PowerShell 7.2+. Read-only on both sides. Secrets from the environment:
  TINTRI_USER, TINTRI_PASSWORD, VC_USER, VC_PASSWORD.
  Output: vmstore-vm-map-<UTC>.csv in the current directory.
#>
param(
  [string]$VMstore    = '<VMSTORE_FQDN>',
  [string]$VCenter    = '<VCENTER_FQDN>',
  [string]$ApiVersion = 'v310.207',
  [string]$ClusterId  = ''            # optional vCenter cluster id (domain-cNN) to stay under the 4000-VM list limit
)
$ErrorActionPreference = 'Stop'
$tb = "https://$VMstore/api"
$vb = "https://$VCenter/api"

# --- VMstore session (cookie)
$cred = @{ typeId = 'com.tintri.api.rest.vcommon.dto.rbac.RestApiCredentials'
           username = $env:TINTRI_USER; password = $env:TINTRI_PASSWORD; fullApiVersion = $ApiVersion } | ConvertTo-Json
Invoke-RestMethod "$tb/v310/session/login" -Method Post -Body $cred -ContentType 'application/json' -SessionVariable ts | Out-Null

# --- vCenter session (token header)
$pair  = [Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes("$($env:VC_USER):$($env:VC_PASSWORD)"))
$token = Invoke-RestMethod "$vb/session" -Method Post -Headers @{ Authorization = "Basic $pair" }
$vh    = @{ 'vmware-api-session-id' = $token }

try {
  # all live VMs on the VMstore, following .next
  $vms = [System.Collections.Generic.List[object]]::new()
  $url = "$tb/v310/vm?live=TRUE&limit=500"
  while ($url) {
    $page = Invoke-RestMethod $url -WebSession $ts
    $page.items | ForEach-Object { $vms.Add($_) }
    $url = if ($page.next) { "$tb/v310/vm?$($page.next)" } else { $null }
  }

  # vCenter inventory once (ids and names)
  $listUrl = if ($ClusterId) { "$vb/vcenter/vm?clusters=$ClusterId" } else { "$vb/vcenter/vm" }
  $vcVms   = Invoke-RestMethod $listUrl -Headers $vh
  $byId    = @{}; $vcVms | ForEach-Object { $byId[$_.vm] = $_ }
  $byName  = $vcVms | Group-Object name -AsHashTable -AsString

  $rows = foreach ($v in $vms) {
    $w = $v.vmware
    # skip non-VMware objects and VMs managed by another vCenter (-VCenter must match the name the VMstore reports)
    if (-not $w -or ($w.vcenterName -and $w.vcenterName -ne $VCenter)) { continue }
    $status = 'NOT_IN_VCENTER'; $vcUuid = $null
    if ($w.mor -and $byId.ContainsKey($w.mor)) {
      $detail = Invoke-RestMethod "$vb/vcenter/vm/$($w.mor)" -Headers $vh
      $vcUuid = $detail.identity.instance_uuid
      $status = if (@($w.instanceUuids) -contains $vcUuid) { 'MATCH' } else { 'UUID_MISMATCH' }
    } elseif ($byName -and $byName.ContainsKey($w.name)) {
      $status = if (@($byName[$w.name]).Count -gt 1) { 'NAME_ONLY_DUPLICATE' } else { 'NAME_ONLY' }
    }
    [pscustomobject]@{
      Name            = $w.name
      TintriUuid      = $v.uuid.uuid
      MoRef           = $w.mor
      VMstoreInstance = (@($w.instanceUuids) -join ';')
      vCenterInstance = $vcUuid
      Host            = $w.host
      Status          = $status
    }
  }
  $file = "vmstore-vm-map-$((Get-Date).ToUniversalTime().ToString('yyyyMMddTHHmmssZ')).csv"
  $rows | Sort-Object Status, Name | Export-Csv $file -NoTypeInformation
  $rows | Group-Object Status | Select-Object Name, Count | Format-Table -AutoSize
  Write-Host "Wrote $file"
}
finally {
  Invoke-RestMethod "$tb/v310/session/logout" -Method Post -WebSession $ts | Out-Null
  Invoke-RestMethod "$vb/session" -Method Delete -Headers $vh | Out-Null
}

Expected output on a healthy estate is one line, MATCH with your VM count. Anything else is worth a look before you automate: UUID_MISMATCH usually means a VM was re-registered or restored and the VMstore has not refreshed its view yet, NAME_ONLY means the MoRef format or the vCenter differs, and NOT_IN_VCENTER is a VM the VMstore still sees files for that vCenter no longer has, which is the start of an orphan clean-up. Run it with a Read Only account on both sides.

08. Snapshots: create, list, delete

A manual VMstore snapshot is one POST with a list of SnapshotSpec objects, which means one call can snapshot many VMs. The response is a list of snapshot Tintri UUIDs (they contain -SST-), in the same order as the specs.

POST /api/v310/snapshot HTTP/1.1
Host: vmstore01.lab.local
Cookie: JSESSIONID=<opaque>
Content-Type: application/json

[
  {
    "typeId": "com.tintri.api.rest.v310.dto.domain.beans.snapshot.SnapshotSpec",
    "consistency": "CRASH_CONSISTENT",
    "retentionMinutes": 240,
    "snapshotName": "pre-patch-2026-12",
    "sourceVmTintriUUID": "A1D88A8A-8904-1E35-9DC2-589C317D31A6-VIM-0000000000000070"
  }
]

HTTP/1.1 200 OK
["A1D88A8A-8904-1E35-9DC2-589C317D31A6-SST-0000000000000412"]
  • consistency: CRASH_CONSISTENT is a VMstore-only snapshot. VM_CONSISTENT makes the VMstore ask vCenter for a vSphere snapshot first (through the registered service account), so it needs a working vCenter registration and it briefly stuns the VM. APP_CONSISTENT is documented as not used.
  • retentionMinutes and replicaRetentionMinutes: if set, must be -1 or greater than 59. The DTO says that without retention the snapshot has unlimited retention, and the POST description says manual snapshots need to be deleted explicitly. Treat API snapshots as yours to delete, and verify the expirationTime the VMstore reports on your build before relying on retention to clean up.
  • The ceiling: the SnapshotSpec reference warns that a VM can only have 128 snapshots, so manual snapshots eat into the room your schedules need. This is why the snapshot sprawl audit exists.
# List the user-generated snapshots of one VM, newest first (curl, logged-in "${CURL[@]}")
"${CURL[@]}" "https://$VMSTORE/api/v310/snapshot?vmUuid=$VM_UUID&type=USER_GENERATED_SNAPSHOT&sortedBy=createTime&sortOrder=DESC&limit=50" |
  jq -r '.items[] | [.uuid.uuid, .description // "", .consistency, (.createTime|tostring), (.expirationTime|tostring)] | @tsv'

# One snapshot by Tintri UUID, then delete it
"${CURL[@]}" "https://$VMSTORE/api/v310/snapshot/$SNAP_UUID" | jq '{vmName, consistency, type, createTime, locked}'
"${CURL[@]}" -X DELETE "https://$VMSTORE/api/v310/snapshot/$SNAP_UUID"; echo

Snapshot time fields (createTime, expirationTime) are milliseconds since 1970 per the DTO. The sortedBy and sortOrder parameters are part of the common filter spec; check that createTime is accepted as a sort key on your build, and fall back to sorting client-side if not. Two deletion calls deserve care. DELETE /v310/snapshot/{tintriUuid} removes one snapshot. DELETE /v310/snapshot?vmUuid=<uuid> removes snapshots belonging to that VM, with vmUuid mandatory; never build that URL from a variable that might be empty. Locked snapshots (POST /v310/snapshot/{uuid}/lock and /unlock, since v310.183) need the Data Protection Admin role and are the right tool for ransomware-resistant restore points.

Python: the snapshot lifecycle in one script

#!/usr/bin/env python3
"""vmstore_snapshot.py: create, list and delete VMstore snapshots for one VM by name.
Env: TINTRI_USER, TINTRI_PASSWORD; optional TINTRI_CA (PEM bundle). Python 3.9+, requests.
Examples:
  vmstore_snapshot.py --vmstore vmstore01.lab.local --vm app01 list
  vmstore_snapshot.py --vmstore vmstore01.lab.local --vm app01 create --name pre-patch --minutes 240
  vmstore_snapshot.py --vmstore vmstore01.lab.local --vm app01 delete --uuid <SNAPSHOT_UUID>
"""
import argparse, os, sys, requests

API_VERSION = "v310.207"

def main():
    ap = argparse.ArgumentParser()
    ap.add_argument("--vmstore", required=True)
    ap.add_argument("--vm", required=True)
    sub = ap.add_subparsers(dest="action", required=True)
    sub.add_parser("list")
    c = sub.add_parser("create"); c.add_argument("--name", required=True)
    c.add_argument("--minutes", type=int, default=240)
    c.add_argument("--consistency", choices=["CRASH_CONSISTENT", "VM_CONSISTENT"], default="CRASH_CONSISTENT")
    d = sub.add_parser("delete"); d.add_argument("--uuid", required=True)
    a = ap.parse_args()

    base = f"https://{a.vmstore}/api/v310"
    s = requests.Session()
    s.verify = os.environ.get("TINTRI_CA", True)
    s.headers.update({"Accept": "application/json"})
    r = s.post(f"{base}/session/login", json={
        "typeId": "com.tintri.api.rest.vcommon.dto.rbac.RestApiCredentials",
        "username": os.environ["TINTRI_USER"], "password": os.environ["TINTRI_PASSWORD"],
        "fullApiVersion": API_VERSION}, timeout=60)
    r.raise_for_status()                       # JSESSIONID now lives in s.cookies
    try:
        r = s.get(f"{base}/vm", params={"name": a.vm, "live": "TRUE"}, timeout=60); r.raise_for_status()
        hits = [v for v in r.json().get("items", []) if v.get("vmware", {}).get("name") == a.vm]
        if len(hits) != 1:
            sys.exit(f"expected exactly one live VM named {a.vm}, found {len(hits)}")
        vm_uuid = hits[0]["uuid"]["uuid"]

        if a.action == "list":
            r = s.get(f"{base}/snapshot", params={"vmUuid": vm_uuid, "limit": 200}, timeout=60); r.raise_for_status()
            for sn in r.json().get("items", []):
                print(sn["uuid"]["uuid"], sn.get("type"), sn.get("consistency"),
                      sn.get("createTime"), sn.get("expirationTime"), sn.get("description", ""), sep="\t")
        elif a.action == "create":
            spec = [{"typeId": "com.tintri.api.rest.v310.dto.domain.beans.snapshot.SnapshotSpec",
                     "consistency": a.consistency, "retentionMinutes": a.minutes,
                     "snapshotName": a.name, "sourceVmTintriUUID": vm_uuid}]
            r = s.post(f"{base}/snapshot", json=spec, timeout=300)
            if r.status_code >= 400:
                sys.exit(f"HTTP {r.status_code}: {r.text}")
            print("created", r.json()[0])
        else:
            r = s.get(f"{base}/snapshot/{a.uuid}", timeout=60); r.raise_for_status()
            if r.json().get("vmUuid", {}).get("uuid") != vm_uuid:
                sys.exit("snapshot does not belong to this VM, refusing to delete")
            r = s.delete(f"{base}/snapshot/{a.uuid}", timeout=120)
            print(r.status_code, r.text)
    finally:
        s.post(f"{base}/session/logout", timeout=30)

if __name__ == "__main__":
    main()

09. Per-VM QoS by API

QoS on a VMstore is per VM, in normalized IOPS (I/O normalized to 8 KB), with a minimum and a maximum; part 3 covers when to use either. The API has three calls worth knowing.

PUT /api/v310/vm/A1D88A8A-8904-1E35-9DC2-589C317D31A6-VIM-0000000000000070/qosConfig HTTP/1.1
Host: vmstore01.lab.local
Cookie: JSESSIONID=<opaque>
Content-Type: application/json

{
  "typeId": "com.tintri.api.rest.v310.dto.Request",
  "objectsWithNewValues": [{
    "typeId": "com.tintri.api.rest.v310.dto.domain.beans.vm.VirtualMachineQoSConfig",
    "minNormalizedIops": 0,
    "maxNormalizedIops": 5000
  }],
  "propertiesToBeUpdated": ["minNormalizedIops", "maxNormalizedIops"]
}

HTTP/1.1 204 No Content
# Bulk: the same ceiling on several VMs in one call (PowerShell, $tintri session)
$body = @{
  typeId        = 'com.tintri.api.rest.v310.dto.MultipleSelectionRequest'
  ids           = @('<VM_UUID_1>', '<VM_UUID_2>')
  newValue      = @{ typeId = 'com.tintri.api.rest.v310.dto.domain.beans.vm.VirtualMachineQoSConfig'
                     minNormalizedIops = 0; maxNormalizedIops = 5000 }
  propertyNames = @('minNormalizedIops', 'maxNormalizedIops')
} | ConvertTo-Json -Depth 5
Invoke-RestMethod "$base/v310/vm/qosConfig" -Method Put -Body $body -ContentType 'application/json' -WebSession $tintri

# Read back what is configured and what is in effect
$vm = Invoke-RestMethod "$base/v310/vm/<VM_UUID_1>" -WebSession $tintri
$vm.qosConfig | Select-Object minNormalizedIops, maxNormalizedIops, effectiveMinNormalizedIops,
                             effectiveMaxNormalizedIops, inheritanceEnabled, lastUpdatedTime
  • Zero means default. The DTO says a VM on default QoS reports 0 for both values. To remove a ceiling, set it back to 0 rather than to a large number, so audits can tell “no ceiling” from “very high ceiling”.
  • Configured versus effective. effectiveMinNormalizedIops and effectiveMaxNormalizedIops show what is actually applied, and inheritanceEnabled says whether the VM inherits QoS from a service group. Compare configured with effective in every audit; the QoS audit post builds that report.
  • System view. GET /v310/datastore/default/qosInfo (since v310.21) returns system-wide QoS information such as the total minimum IOPS allocated. Check it before adding floors, because floors are promises the box has to keep for everyone at once.
  • Record what you change. Read the current values first and write them somewhere, so the change can be reversed exactly. The Postman collection does this: it saves origQosMin/origQosMax in Discover and restores them in Cleanup.

10. SyncVM, clones and task polling

SyncVM and clone are the two calls that make Tintri popular with test and DBA teams, and both are asynchronous: they return a Task, and you poll GET /v310/task/{id} until jobDone is true. The task states are QUEUED, RUNNING, SUCCESS, FAILED, CANCELLED, CANCEL_PENDING; on failure, error carries a TintriError.

SyncVM

POST /v310/vm/sync (since v310.21, VMstore only) overwrites a target VM, or selected disks of it, with the content of a snapshot, keeping the target VM’s identity in vCenter. Three types exist: FULL_VM, VDISK and FILE_RESTORE (attach snapshot disks to the VM for guest file-level restore). For VDISK, isSkipReboot: false (the default) stops and starts the VM around the operation; with true you are responsible for stopping I/O to those disks.

POST /api/v310/vm/sync HTTP/1.1
Host: vmstore01.lab.local
Cookie: JSESSIONID=<opaque>
Content-Type: application/json

{
  "typeId": "com.tintri.api.rest.v310.dto.domain.beans.vm.VirtualMachineSyncSpec",
  "type": "VDISK",
  "targetVmTintriUuids": ["<TEST_VM_UUID>"],
  "snapshotTintriUuid": "<PROD_SNAPSHOT_UUID>",
  "sourceDisks": ["scsi0:1"],
  "destDisks": ["scsi0:1"]
}

HTTP/1.1 200 OK
{ "typeId": "com.tintri.api.rest.v310.dto.Task", "uuid": { "uuid": "<TASK_ID>" },
  "type": "SYNC_VM", "state": "QUEUED", "jobDone": false }

This is destructive by design. SyncVM replaces the target’s data. In the Postman collection it is named [DESTRUCTIVE] and skipped unless you set allowDestructive=true, on top of allowWrites=true. Put the same two-key guard in any pipeline that calls it, and double-check the target UUID against vCenter with the mapping in section 07 first.

Clone

POST /v310/vm with a VirtualMachineCloneSpec clones from a VM (vmId, the VMstore takes a snapshot first with the given consistency) or from an existing snapshot (snapshotId), count times (1 to 500 for VMware). The vmware block names the clone and where it lands: cloneVmName, vCenterName (the vCenter as registered on the VMstore), datastoreName, and optionally hostClusterMoref and folderMoref. The VMstore registers the clone in vCenter itself; per the DTO, without a valid vCenterName the clone is not added to inventory.

POST /api/v310/vm HTTP/1.1
Host: vmstore01.lab.local
Cookie: JSESSIONID=<opaque>
Content-Type: application/json

{
  "typeId": "com.tintri.api.rest.v310.dto.domain.beans.vm.VirtualMachineCloneSpec",
  "snapshotId": "A1D88A8A-8904-1E35-9DC2-589C317D31A6-SST-0000000000000412",
  "consistency": "CRASH_CONSISTENT",
  "count": 1,
  "vmware": {
    "typeId": "com.tintri.api.rest.v310.dto.domain.beans.vm.VirtualMachineCloneSpec$VMwareCloneInfo",
    "cloneVmName": "app01-test",
    "vCenterName": "vcenter01.lab.local",
    "datastoreName": "default"
  }
}

HTTP/1.1 200 OK
{ "typeId": "com.tintri.api.rest.v310.dto.Task", "uuid": { "uuid": "<TASK_ID>" },
  "type": "CLONE", "state": "QUEUED", "jobDone": false }

Two details from the public material. The nested typeId above is the one in Tintri’s own clone sample (VirtualMachineCloneSpec$VMwareCloneInfo); the DTO page lists it as com.tintri.api.rest.v310.dto.domain.beans.vm.VMwareCloneInfo, so if your build rejects one, try the other and check the API reference for your TxOS version. And datastoreName is default in Tintri’s Python SDK clone example, which first confirms that GET /v310/datastore/default/hostResources lists the vCenter as a COMPUTE_RESOURCE; do the same check before cloning. Avoid preserveInstanceUuid: true unless you are restoring a replacement for a deleted VM, because two live VMs with one instance UUID break every identity check in section 07.

# Wait-TintriTask: poll a VMstore task until it finishes (PowerShell, $tintri session)
function Wait-TintriTask {
  param([string]$Base, [Microsoft.PowerShell.Commands.WebRequestSession]$Session,
        [string]$TaskId, [int]$DelaySeconds = 5, [int]$MaxTries = 120)
  for ($i = 1; $i -le $MaxTries; $i++) {
    $t = Invoke-RestMethod "$Base/v310/task/$TaskId" -WebSession $Session
    Write-Host ("{0} {1} {2}% {3}" -f $t.type, $t.state, [int]$t.progressPercent, $t.progressDescription)
    if ($t.jobDone) {
      if ($t.state -ne 'SUCCESS') { throw "Task $TaskId ended $($t.state): $($t.error.code) $($t.error.message)" }
      return $t
    }
    Start-Sleep -Seconds $DelaySeconds
  }
  throw "Task $TaskId still running after $MaxTries polls"
}

$task = Invoke-RestMethod "$base/v310/vm" -Method Post -Body $cloneJson -ContentType 'application/json' -WebSession $tintri
Wait-TintriTask -Base $base -Session $tintri -TaskId $task.uuid.uuid | Select-Object state, targetIds

11. Replication and alerts

Replication

Replication is configured at two levels: paths on the datastore (where to), and per-VM configurations (what, how often, and the RPO alert). For a vSphere team, reading both is daily work and writing them is best left to policy: TGC service groups (post 23) or the VMstore default policy, not per-VM API calls scattered through scripts.

CallSinceNotes
GET /v310/datastore/default/replicationPathv310 (pre-v310.101)Outgoing paths: displayName, sourceIp, destinationIp, destinationPort, throttle
POST /v310/datastore/default/testReplicationPathv310.41Tests a path; returns an empty string on success. Replaces the deprecated PUT .../replicationPath/test
GET /v310/vm/{vmId}v310 (pre-v310.101)replication: isEnabled, replicationState, configurationsOutgoing (each with alertThresholdMinutes, isPaused, latestReplicatedSnapshotTime)
PUT /v310/vm/{vmId}/replicationConfigsv310.21Sets a VM’s outgoing configurations (a list of VirtualMachineReplicationConfig). Replaces the per-config /vm/{vmId}/replicationConfig calls, deprecated since v310.61. Build the body from a GET of the VM and check the required fields against the API reference for your TxOS version
GET /v310/datastore/default/replicationConfigv310 (pre-v310.101)The system-wide default replication configuration
# Replication lag report for every live VM that replicates (curl + jq, logged-in "${CURL[@]}")
"${CURL[@]}" "https://$VMSTORE/api/v310/vm?live=TRUE&limit=2000" | jq -r '
  .items[] | select(.replication.isEnabled == true) |
  .vmware.name as $n | (.replication.configurationsOutgoing // [])[] |
  [$n, .path.displayName // "", .replicationState // "", (.latestReplicatedSnapshotTime|tostring),
   (.alertThresholdMinutes|tostring), (.isPaused|tostring)] | @tsv' | column -t -s $'\t'

Alerts

GET /v310/alert returns a page of Alert objects (severity ALERT or NOTICE, state NEW, ACKNOWLEDGED or ARCHIVED, message, source, notifiedTimestamp), filterable by state, severity and since. On TxOS 5.6 and later there is also GET /v310/alert/paginated (v310.191). Note that PUT /v310/alert/markRead and markArchived act on all alerts; do not call them from a monitoring script, or the people who read the UI lose their unread markers.

GET /api/v310/alert?state=NEW&severity=ALERT&limit=50 HTTP/1.1
Host: vmstore01.lab.local
Cookie: JSESSIONID=<opaque>

HTTP/1.1 200 OK
{ "typeId": "com.tintri.api.rest.v310.dto.Page", "filteredTotal": 1,
  "items": [ { "typeId": "com.tintri.api.rest.v310.dto.domain.Alert",
               "severity": "ALERT", "state": "NEW", "source": "<component>",
               "message": "<alert text>", "notifiedTimestamp": 1764662400000 } ] }

12. Packet flow: the network under the API

API problems and storage problems get confused because both show up as “the VMstore is not responding”. They run on different networks. The API runs on the management VLAN, over HTTPS, and fails with TLS errors, timeouts or 401s. The NFS data path runs on the storage VLAN and fails with slow I/O, APD events and, the classic, an MTU black hole where small packets pass and large ones vanish. Figure 3 shows both, hop by hop, with the places packets are dropped in the two most common misconfigurations.

A. Data path: one NFS write from a guest to the VMstore 1 Guest OS write to vDisk (virtual SCSI) 2 ESXi NFS client NFSv3 over TCP 2049 3 vmk2 10.0.30.21 MTU 9000 4 vDS pg-nfs-30 adds 802.1Q tag 30 (VST) 5 VIC vNIC A fabric A, MTU 9000 UCS QoS class 6 FI A appliance port, VLAN 30 allowed 7 VMstore data IP 10.0.30.50 active controller untagged inside the host 802.1Q VLAN 30 on the wire (or native on the appliance port, per your design) MTU must match at every hop from vmk2 to the VMstore data interface (Nexus/FI system MTU 9216 if in path) MTU black hole (marker between hops 5 and 6) vmk2 at 9000 but one hop at 1500: the mount and small pings work, large writes are dropped silently. Test: vmkping -I vmk2 -d -s 8972 Wrong or missing VLAN 30 (marker between hops 6 and 7) vNIC template, FI appliance port or VMstore data interface lacks VLAN 30: the mount fails with “Unable to connect to NFS server” vNIC B (fabric B) FI B appliance port VMstore data port B Standby path, used only when fabric A fails. Teaming: explicit failover, A active, B standby, no LACP to the FIs (part 4). B. Control and API paths (all on mgmt VLAN 10 unless shown) Admin workstation 10.0.10.50 vcenter01 10.0.10.10 VMstore admin IP 10.0.10.40 ESXi hosts (vmk0) 10.0.10.21 to .24 DR VMstore replication VLAN 40 HTTPS 443: /api/session, /api/vcenter/… HTTPS 443: /api/v310/… (TLS 1.2) 443 and 902 (host agent) 443: VM mapping, VM-consistent snapshots TCP 1304 async, 1338 sync * vMotion: vmk1 to vmk1, TCP 8000 VLAN 20, never via the API host TLS: TxOS and TGC 5.6.0.1 and later accept TLS 1.2 only, so an old client fails the handshake before any 401. * Default ports from Tintri VMware best-practices guide rev 3.1; confirm in the service port list for your TxOS release. data path (NFS) control / API standby path replication where packets are dropped VLAN, IP and MTU values are examples
Figure 3. Hop-by-hop data path (NFSv3, TCP 2049) from a guest write to the VMstore data IP, with the fabric B standby path, and the control/API paths with their ports. Amber markers show where packets are dropped by an MTU mismatch or a missing VLAN.
HopProtocol / portCheck fromCommandExpected
Workstation to VMstore APIHTTPS, TCP 443, TLS 1.2Workstationcurl -sS https://vmstore01.lab.local/api/info200 and a RestApi JSON. TLS 1.2 only on TxOS 5.6.0.1 and later
Workstation to vCenter APIHTTPS, TCP 443Workstationcurl -sS -o /dev/null -w "%{http_code}" https://vcenter01.lab.local/api/session401 (reachable, needs auth)
VMstore to vCenterHTTPS, TCP 443VMstore APIGET .../hypervisorManagerConfig/{id}?refresh=falseA ping status that is not an error
vmk2 to VMstore data IPNFSv3, TCP 2049ESXi shellvmkping -I vmk2 -d -s 8972 10.0.30.500% loss with MTU 9000 (use -s 1472 for 1500)
NFS mount stateNFSv3ESXi shellesxcli storage nfs listAccessible true, Mounted true, Hardware Acceleration Supported
VMstore to DR VMstoreTCP 1304 async, 1338 sync (defaults in Tintri’s published guide)VMstore APIPOST .../testReplicationPathEmpty string (success)

The ports for vCenter (443), vCenter to ESXi (443 and 902), vMotion (TCP 8000) and NFS (2049) are Broadcom’s; the replication ports are the defaults in Tintri’s VMware best-practices guide, so confirm them against the service port list for your TxOS release before you open firewalls. The full MTU and VLAN design is in part 2, and the jumbo frame check automates the vmkping row across every host.

13. The Postman collection and newman

The collection runs the whole guide in order: 01 Auth (API info, VMstore login, current session, vCenter login), 02 Discover (appliance, status, controllers, failed parts, vCenter registration, datastore stats, find the VM, its realtime stats, its vCenter identity), 03 Configure (snapshot, QoS, clone and task poll, SyncVM and task poll), 04 Verify (snapshot listed, QoS read back, replication paths), 05 Troubleshoot (alerts, paginated alerts, failed tasks, active sessions, vCenter registration ping) and 06 Cleanup and logout (restore QoS, delete the test snapshot, log out of both).

  • Safe by default. A collection-level pre-request script skips any request whose name starts with [WRITE] unless allowWrites is true, and [DESTRUCTIVE] also needs allowDestructive. With the shipped environment, a run is read-only. Skipping uses pm.execution.skipRequest(), which needs the Postman app or newman 6.1.0 or later.
  • Sessions are captured, not typed. The VMstore login test stores JSESSIONID in tintriSession, sent as a Cookie header on every VMstore request; the vCenter login stores the token in vcSession, sent as vmware-api-session-id.
  • 401 handling. A collection-level test catches a 401, runs the right login once and retries the failed request, which is the branch in figure 2.
  • Task polling. The poll requests call themselves with postman.setNextRequest() every taskPollDelayMs until jobDone, up to taskPollMax tries, then assert SUCCESS.
  • Secrets. password and vcenterPassword are secret-type variables with empty values. Supply them at run time; never commit a filled environment.

Save the following as 22-vmware-vsphere-tintri-vmstore-rest-api-guide.postman_collection.json and import it into Postman (Import, Files). The environment is the second block; save it as 22-vmware-vsphere-tintri-vmstore-rest-api-guide.postman_environment.json and import it the same way.

{
  "info": {
    "_postman_id": "b0cf4fd5-1064-54e1-a355-52c0b5d2e258",
    "name": "VMware vSphere + Tintri VMstore REST API (v310.207)",
    "description": "Companion to 'VMware vSphere with Tintri VMstore: the REST API deploy and operations guide' on vmwareblogs.co.in. Run folders in order. Write requests are prefixed [WRITE] and run only when allowWrites=true; [DESTRUCTIVE] requests also need allowDestructive=true. Checked against Tintri REST API v310.207 (TxOS 6.0.3) and the vSphere Automation API 9.x reference.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "noauth"
  },
  "event": [
    {
      "listen": "prerequest",
      "script": {
        "type": "text/javascript",
        "exec": [
          "// Guard: write and destructive requests run only when explicitly enabled.",
          "const name = pm.info.requestName || '';",
          "if (name.startsWith('[WRITE]') && pm.environment.get('allowWrites') !== 'true') {",
          "  console.log('SKIP ' + name + ' (set allowWrites=true to run)');",
          "  pm.execution.skipRequest();",
          "}",
          "if (name.startsWith('[DESTRUCTIVE]') && pm.environment.get('allowDestructive') !== 'true') {",
          "  console.log('SKIP ' + name + ' (set allowDestructive=true to run)');",
          "  pm.execution.skipRequest();",
          "}"
        ]
      }
    },
    {
      "listen": "test",
      "script": {
        "type": "text/javascript",
        "exec": [
          "// 401 handling: log in again once, then retry the request that failed.",
          "if (pm.response.code === 401) {",
          "  const isVc = pm.request.headers.has('vmware-api-session-id');",
          "  const flag = isVc ? 'retryAfterVcLogin' : 'retryAfterLogin';",
          "  if (!pm.environment.get(flag + 'Used')) {",
          "    pm.environment.set(flag + 'Used', '1');",
          "    pm.environment.set(flag, pm.info.requestName);",
          "    console.warn('401 on ' + pm.info.requestName + ': logging in again and retrying once');",
          "    postman.setNextRequest(isVc ? 'Login to vCenter' : 'Login to VMstore');",
          "  }",
          "}",
          "if (pm.response.code >= 400) {",
          "  try { const e = pm.response.json(); console.warn(JSON.stringify(e)); } catch (err) { console.warn(pm.response.text()); }",
          "}"
        ]
      }
    }
  ],
  "item": [
    {
      "name": "01 Auth",
      "item": [
        {
          "name": "Get API info",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": "{{baseUrl}}/api/info",
            "description": "Unauthenticated. Returns RestApi: productName, preferredVersion, supportedVersionSet."
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const retrying = pm.response.code === 401 && [pm.environment.get('retryAfterLogin'), pm.environment.get('retryAfterVcLogin')].includes(pm.info.requestName);",
                  "if (retrying) { console.log('401: retry scheduled after login, assertions deferred'); } else {",
                  "pm.test('GET /api/info returns 200', () => pm.response.to.have.status(200));",
                  "const info = pm.response.json();",
                  "pm.test('supportedVersionSet is present', () => pm.expect(info.supportedVersionSet).to.be.an('array').that.is.not.empty);",
                  "console.log('productName=' + info.productName + ' preferredVersion=' + info.preferredVersion +",
                  "            ' supported=' + JSON.stringify(info.supportedVersionSet));",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "Login to VMstore",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": "{{baseUrl}}/api/v310/session/login",
            "description": "Returns the role name as the body and sets the JSESSIONID cookie.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"typeId\": \"com.tintri.api.rest.vcommon.dto.rbac.RestApiCredentials\",\n  \"username\": \"{{username}}\",\n  \"password\": \"{{password}}\",\n  \"fullApiVersion\": \"{{fullApiVersion}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('login returns 200', () => pm.response.to.have.status(200));",
                  "const sid = pm.cookies.get('JSESSIONID');",
                  "pm.test('JSESSIONID cookie captured', () => pm.expect(sid).to.be.a('string').and.not.empty);",
                  "pm.environment.set('tintriSession', sid);",
                  "console.log('logged in, role: ' + pm.response.text());",
                  "const retry = pm.environment.get('retryAfterLogin');",
                  "if (retry) { pm.environment.unset('retryAfterLogin'); postman.setNextRequest(retry); }"
                ]
              }
            }
          ]
        },
        {
          "name": "Get current VMstore session",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Cookie",
                "value": "JSESSIONID={{tintriSession}}"
              }
            ],
            "url": "{{baseUrl}}/api/v310/session/current"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const retrying = pm.response.code === 401 && [pm.environment.get('retryAfterLogin'), pm.environment.get('retryAfterVcLogin')].includes(pm.info.requestName);",
                  "if (retrying) { console.log('401: retry scheduled after login, assertions deferred'); } else {",
                  "pm.test('session/current returns 200', () => pm.response.to.have.status(200));",
                  "const s = pm.response.json();",
                  "pm.test('session belongs to the configured user', () => pm.expect(String(s.userName).toLowerCase()).to.include(String(pm.environment.get('username')).toLowerCase()));",
                  "console.log('roles=' + JSON.stringify(s.roles) + ' expires=' + s.expirationTime);",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "Login to vCenter",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": "{{vcenterUrl}}/api/session",
            "description": "vSphere Automation API session. The body is the token string; send it as vmware-api-session-id.",
            "auth": {
              "type": "basic",
              "basic": [
                {
                  "key": "username",
                  "value": "{{vcenterUsername}}",
                  "type": "string"
                },
                {
                  "key": "password",
                  "value": "{{vcenterPassword}}",
                  "type": "string"
                }
              ]
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('vCenter session created', () => pm.expect(pm.response.code).to.be.oneOf([200, 201]));",
                  "const token = pm.response.json();",
                  "pm.test('token is a string', () => pm.expect(token).to.be.a('string').and.not.empty);",
                  "pm.environment.set('vcSession', token);",
                  "const retry = pm.environment.get('retryAfterVcLogin');",
                  "if (retry) { pm.environment.unset('retryAfterVcLogin'); postman.setNextRequest(retry); }"
                ]
              }
            }
          ]
        }
      ]
    },
    {
      "name": "02 Discover",
      "item": [
        {
          "name": "Appliance info",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Cookie",
                "value": "JSESSIONID={{tintriSession}}"
              }
            ],
            "url": "{{baseUrl}}/api/v310/appliance/{{datastoreId}}/info"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const retrying = pm.response.code === 401 && [pm.environment.get('retryAfterLogin'), pm.environment.get('retryAfterVcLogin')].includes(pm.info.requestName);",
                  "if (retrying) { console.log('401: retry scheduled after login, assertions deferred'); } else {",
                  "pm.test('200', () => pm.response.to.have.status(200));",
                  "const a = pm.response.json();",
                  "pm.test('model and TxOS version reported', () => { pm.expect(a.modelName).to.be.a('string'); pm.expect(a.osVersion).to.be.a('string'); });",
                  "console.log(`model=${a.modelName} TxOS=${a.osVersion} allFlash=${a.isAllFlash}`);",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "Operational status",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Cookie",
                "value": "JSESSIONID={{tintriSession}}"
              }
            ],
            "url": "{{baseUrl}}/api/v310/appliance/{{datastoreId}}/operationalStatus"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const retrying = pm.response.code === 401 && [pm.environment.get('retryAfterLogin'), pm.environment.get('retryAfterVcLogin')].includes(pm.info.requestName);",
                  "if (retrying) { console.log('401: retry scheduled after login, assertions deferred'); } else {",
                  "pm.test('200', () => pm.response.to.have.status(200));",
                  "const o = pm.response.json();",
                  "pm.test('file system is up', () => pm.expect(o.isFilesystemUp).to.eql(true));",
                  "pm.test('no urgent message', () => pm.expect(o.urgentMessage || '').to.eql(''));",
                  "console.log(`uptime=${o.uptime} unreadAlerts=${o.alertsUnreadCount} restartFlag=${o.restartFlag}`);",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "Controllers",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Cookie",
                "value": "JSESSIONID={{tintriSession}}"
              }
            ],
            "url": "{{baseUrl}}/api/v310/appliance/{{datastoreId}}/controller"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const retrying = pm.response.code === 401 && [pm.environment.get('retryAfterLogin'), pm.environment.get('retryAfterVcLogin')].includes(pm.info.requestName);",
                  "if (retrying) { console.log('401: retry scheduled after login, assertions deferred'); } else {",
                  "pm.test('200', () => pm.response.to.have.status(200));",
                  "let c = pm.response.json();",
                  "c = Array.isArray(c) ? c : (c.items || [c]);",
                  "const roles = c.map(x => x.role);",
                  "console.log(c.map(x => `${x.locator} ${x.role} ${x.state} ${x.osVersion}`).join(' | '));",
                  "pm.test('exactly one ACTIVE controller', () => pm.expect(roles.filter(r => r === 'ACTIVE').length).to.eql(1));",
                  "pm.test('a STANDBY controller is present', () => pm.expect(roles).to.include('STANDBY'));",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "Failed components",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Cookie",
                "value": "JSESSIONID={{tintriSession}}"
              }
            ],
            "url": "{{baseUrl}}/api/v310/appliance/{{datastoreId}}/failedComponents"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const retrying = pm.response.code === 401 && [pm.environment.get('retryAfterLogin'), pm.environment.get('retryAfterVcLogin')].includes(pm.info.requestName);",
                  "if (retrying) { console.log('401: retry scheduled after login, assertions deferred'); } else {",
                  "pm.test('200', () => pm.response.to.have.status(200));",
                  "console.log('failedComponents: ' + pm.response.text());",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "vCenter registrations (hypervisor managers)",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Cookie",
                "value": "JSESSIONID={{tintriSession}}"
              }
            ],
            "url": "{{baseUrl}}/api/v310/datastore/{{datastoreId}}/hypervisorManagerConfig"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const retrying = pm.response.code === 401 && [pm.environment.get('retryAfterLogin'), pm.environment.get('retryAfterVcLogin')].includes(pm.info.requestName);",
                  "if (retrying) { console.log('401: retry scheduled after login, assertions deferred'); } else {",
                  "pm.test('200', () => pm.response.to.have.status(200));",
                  "const m = pm.response.json();",
                  "const vc = m.filter(x => x.hypervisorType === 'VMWARE');",
                  "pm.test('at least one vCenter is registered', () => pm.expect(vc.length).to.be.above(0));",
                  "vc.forEach(x => console.log(`vCenter ${x.host} user=${x.username} id=${x.hypervisorManagerId}`));",
                  "if (vc.length) { pm.environment.set('hypervisorManagerId', vc[0].hypervisorManagerId); }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "Datastore stats summary",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Cookie",
                "value": "JSESSIONID={{tintriSession}}"
              }
            ],
            "url": "{{baseUrl}}/api/v310/datastore/{{datastoreId}}/statsSummary"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const retrying = pm.response.code === 401 && [pm.environment.get('retryAfterLogin'), pm.environment.get('retryAfterVcLogin')].includes(pm.info.requestName);",
                  "if (retrying) { console.log('401: retry scheduled after login, assertions deferred'); } else {",
                  "pm.test('200', () => pm.response.to.have.status(200));",
                  "const s = pm.response.json();",
                  "console.log(`used ${s.spaceUsedPhysicalGiB} of ${s.spaceTotalGiB} GiB, ${s.spaceRemainingDays} days left, ` +",
                  "            `${s.operationsTotalIops} IOPS, ${s.latencyTotalMs} ms, VMs ${s.vmsCount}`);",
                  "pm.test('capacity fields present', () => pm.expect(s.spaceTotalGiB).to.be.a('number'));",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "Find VM by name",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Cookie",
                "value": "JSESSIONID={{tintriSession}}"
              }
            ],
            "url": "{{baseUrl}}/api/v310/vm?name={{vmName}}&live=TRUE&limit=10"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const retrying = pm.response.code === 401 && [pm.environment.get('retryAfterLogin'), pm.environment.get('retryAfterVcLogin')].includes(pm.info.requestName);",
                  "if (retrying) { console.log('401: retry scheduled after login, assertions deferred'); } else {",
                  "pm.test('200', () => pm.response.to.have.status(200));",
                  "const p = pm.response.json();",
                  "const hits = (p.items || []).filter(v => v.vmware && v.vmware.name === pm.environment.get('vmName'));",
                  "pm.test('exactly one live VM with that name', () => pm.expect(hits.length).to.eql(1));",
                  "if (hits.length === 1) {",
                  "  const v = hits[0];",
                  "  pm.environment.set('vmUuid', v.uuid.uuid);",
                  "  pm.environment.set('vmMor', v.vmware.mor);",
                  "  pm.environment.set('vmInstanceUuid', (v.vmware.instanceUuids || [])[0] || '');",
                  "  pm.environment.set('origQosMin', v.qosConfig ? v.qosConfig.minNormalizedIops : 0);",
                  "  pm.environment.set('origQosMax', v.qosConfig ? v.qosConfig.maxNormalizedIops : 0);",
                  "  console.log(`vmUuid=${v.uuid.uuid} mor=${v.vmware.mor} instanceUuids=${JSON.stringify(v.vmware.instanceUuids)} vCenter=${v.vmware.vcenterName}`);",
                  "}",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "VM realtime stats",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Cookie",
                "value": "JSESSIONID={{tintriSession}}"
              }
            ],
            "url": "{{baseUrl}}/api/v310/vm/{{vmUuid}}/statsRealtime"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const retrying = pm.response.code === 401 && [pm.environment.get('retryAfterLogin'), pm.environment.get('retryAfterVcLogin')].includes(pm.info.requestName);",
                  "if (retrying) { console.log('401: retry scheduled after login, assertions deferred'); } else {",
                  "pm.test('200', () => pm.response.to.have.status(200));",
                  "const items = pm.response.json().items || [];",
                  "const stats = items.length ? (items[0].sortedStats || []) : [];",
                  "const s = stats[stats.length - 1];",
                  "pm.test('at least one sample returned', () => pm.expect(s).to.be.an('object'));",
                  "if (s) console.log(`total ${s.latencyTotalMs} ms = host ${s.latencyHostMs} / net ${s.latencyNetworkMs} / storage ${s.latencyStorageMs} / contention ${s.latencyContentionMs} / throttle ${s.latencyThrottleMs}; IOPS ${s.operationsTotalIops}`);",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "vCenter: confirm VM identity",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "vmware-api-session-id",
                "value": "{{vcSession}}"
              },
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": "{{vcenterUrl}}/api/vcenter/vm/{{vmMor}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const retrying = pm.response.code === 401 && [pm.environment.get('retryAfterLogin'), pm.environment.get('retryAfterVcLogin')].includes(pm.info.requestName);",
                  "if (retrying) { console.log('401: retry scheduled after login, assertions deferred'); } else {",
                  "if (pm.response.code === 404) { console.warn('vCenter has no VM with id ' + pm.environment.get('vmMor') + ': check the mor format or the vCenter this VMstore reports'); }",
                  "pm.test('200 from vCenter', () => pm.response.to.have.status(200));",
                  "const vm = pm.response.json();",
                  "const want = String(pm.environment.get('vmInstanceUuid') || '').toLowerCase();",
                  "pm.test('instance_uuid matches the VMstore record', () => pm.expect(String(vm.identity && vm.identity.instance_uuid).toLowerCase()).to.eql(want));",
                  "console.log(`vCenter name=${vm.name} power=${vm.power_state} instance_uuid=${vm.identity && vm.identity.instance_uuid}`);",
                  "}"
                ]
              }
            }
          ]
        }
      ]
    },
    {
      "name": "03 Configure (writes, opt-in)",
      "item": [
        {
          "name": "[WRITE] Take manual snapshot",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Cookie",
                "value": "JSESSIONID={{tintriSession}}"
              }
            ],
            "url": "{{baseUrl}}/api/v310/snapshot",
            "body": {
              "mode": "raw",
              "raw": "[\n  {\n    \"typeId\": \"com.tintri.api.rest.v310.dto.domain.beans.snapshot.SnapshotSpec\",\n    \"consistency\": \"CRASH_CONSISTENT\",\n    \"retentionMinutes\": {{snapshotRetentionMinutes}},\n    \"snapshotName\": \"{{snapshotName}}\",\n    \"sourceVmTintriUUID\": \"{{vmUuid}}\"\n  }\n]",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const retrying = pm.response.code === 401 && [pm.environment.get('retryAfterLogin'), pm.environment.get('retryAfterVcLogin')].includes(pm.info.requestName);",
                  "if (retrying) { console.log('401: retry scheduled after login, assertions deferred'); } else {",
                  "pm.test('snapshot created', () => pm.expect(pm.response.code).to.be.oneOf([200, 201]));",
                  "const ids = pm.response.json();",
                  "pm.test('one snapshot UUID returned', () => pm.expect(ids).to.be.an('array').with.lengthOf(1));",
                  "pm.environment.set('snapshotUuid', ids[0]);",
                  "console.log('snapshot ' + ids[0]);",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "[WRITE] Set VM QoS",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Cookie",
                "value": "JSESSIONID={{tintriSession}}"
              }
            ],
            "url": "{{baseUrl}}/api/v310/vm/{{vmUuid}}/qosConfig",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"typeId\": \"com.tintri.api.rest.v310.dto.Request\",\n  \"objectsWithNewValues\": [\n    {\n      \"typeId\": \"com.tintri.api.rest.v310.dto.domain.beans.vm.VirtualMachineQoSConfig\",\n      \"minNormalizedIops\": {{qosMin}},\n      \"maxNormalizedIops\": {{qosMax}}\n    }\n  ],\n  \"propertiesToBeUpdated\": [\n    \"minNormalizedIops\",\n    \"maxNormalizedIops\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const retrying = pm.response.code === 401 && [pm.environment.get('retryAfterLogin'), pm.environment.get('retryAfterVcLogin')].includes(pm.info.requestName);",
                  "if (retrying) { console.log('401: retry scheduled after login, assertions deferred'); } else {",
                  "pm.test('QoS update accepted (204)', () => pm.response.to.have.status(204));",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "[WRITE] Clone VM from snapshot",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Cookie",
                "value": "JSESSIONID={{tintriSession}}"
              }
            ],
            "url": "{{baseUrl}}/api/v310/vm",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"typeId\": \"com.tintri.api.rest.v310.dto.domain.beans.vm.VirtualMachineCloneSpec\",\n  \"snapshotId\": \"{{snapshotUuid}}\",\n  \"consistency\": \"CRASH_CONSISTENT\",\n  \"count\": 1,\n  \"vmware\": {\n    \"typeId\": \"com.tintri.api.rest.v310.dto.domain.beans.vm.VirtualMachineCloneSpec$VMwareCloneInfo\",\n    \"cloneVmName\": \"{{cloneName}}\",\n    \"vCenterName\": \"{{vcenterName}}\",\n    \"datastoreName\": \"{{datastoreId}}\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!pm.environment.get('snapshotUuid')) { console.log('No snapshotUuid, skipping clone'); pm.execution.skipRequest(); }"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const retrying = pm.response.code === 401 && [pm.environment.get('retryAfterLogin'), pm.environment.get('retryAfterVcLogin')].includes(pm.info.requestName);",
                  "if (retrying) { console.log('401: retry scheduled after login, assertions deferred'); } else {",
                  "pm.test('clone accepted', () => pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]));",
                  "const t = pm.response.json();",
                  "pm.environment.set('taskId', t.uuid.uuid);",
                  "pm.environment.set('taskPollCount', 0);",
                  "console.log(`clone task ${t.uuid.uuid} ${t.state}`);",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "[WRITE] Poll clone task",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Cookie",
                "value": "JSESSIONID={{tintriSession}}"
              }
            ],
            "url": "{{baseUrl}}/api/v310/task/{{taskId}}"
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const n = Number(pm.environment.get('taskPollCount') || 0);",
                  "if (!pm.environment.get('taskId')) { console.log('No taskId set, skipping poll'); pm.execution.skipRequest(); }",
                  "if (n > 0) { setTimeout(() => {}, Number(pm.environment.get('taskPollDelayMs') || 5000)); }"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const retrying = pm.response.code === 401 && [pm.environment.get('retryAfterLogin'), pm.environment.get('retryAfterVcLogin')].includes(pm.info.requestName);",
                  "if (retrying) { console.log('401: retry scheduled after login, assertions deferred'); } else {",
                  "pm.test('task lookup returns 200', () => pm.response.to.have.status(200));",
                  "const t = pm.response.json();",
                  "const n = Number(pm.environment.get('taskPollCount') || 0) + 1;",
                  "const max = Number(pm.environment.get('taskPollMax') || 60);",
                  "console.log(`task ${t.uuid && t.uuid.uuid} ${t.type} ${t.state} ${t.progressPercent || 0}% try ${n}/${max}`);",
                  "if (!t.jobDone && n < max) {",
                  "  pm.environment.set('taskPollCount', n);",
                  "  postman.setNextRequest(pm.info.requestName);",
                  "} else {",
                  "  pm.environment.set('taskPollCount', 0);",
                  "  pm.environment.unset('taskId');",
                  "  if (t.error) { console.log('TintriError: ' + JSON.stringify(t.error)); }",
                  "  pm.test('task finished with state SUCCESS', () => pm.expect(t.state).to.eql('SUCCESS'));",
                  "}",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "[DESTRUCTIVE] SyncVM: restore one vDisk from snapshot",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Cookie",
                "value": "JSESSIONID={{tintriSession}}"
              }
            ],
            "url": "{{baseUrl}}/api/v310/vm/sync",
            "description": "Overwrites the target VM's disk with the disk from the snapshot. The target VM is stopped and started unless isSkipReboot is true.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"typeId\": \"com.tintri.api.rest.v310.dto.domain.beans.vm.VirtualMachineSyncSpec\",\n  \"type\": \"VDISK\",\n  \"targetVmTintriUuids\": [\n    \"{{syncTargetVmUuid}}\"\n  ],\n  \"snapshotTintriUuid\": \"{{syncSnapshotUuid}}\",\n  \"sourceDisks\": [\n    \"{{syncDisk}}\"\n  ],\n  \"destDisks\": [\n    \"{{syncDisk}}\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const retrying = pm.response.code === 401 && [pm.environment.get('retryAfterLogin'), pm.environment.get('retryAfterVcLogin')].includes(pm.info.requestName);",
                  "if (retrying) { console.log('401: retry scheduled after login, assertions deferred'); } else {",
                  "pm.test('sync accepted', () => pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]));",
                  "const t = pm.response.json();",
                  "pm.environment.set('taskId', t.uuid.uuid);",
                  "pm.environment.set('taskPollCount', 0);",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "[DESTRUCTIVE] Poll sync task",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Cookie",
                "value": "JSESSIONID={{tintriSession}}"
              }
            ],
            "url": "{{baseUrl}}/api/v310/task/{{taskId}}"
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const n = Number(pm.environment.get('taskPollCount') || 0);",
                  "if (!pm.environment.get('taskId')) { console.log('No taskId set, skipping poll'); pm.execution.skipRequest(); }",
                  "if (n > 0) { setTimeout(() => {}, Number(pm.environment.get('taskPollDelayMs') || 5000)); }"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const retrying = pm.response.code === 401 && [pm.environment.get('retryAfterLogin'), pm.environment.get('retryAfterVcLogin')].includes(pm.info.requestName);",
                  "if (retrying) { console.log('401: retry scheduled after login, assertions deferred'); } else {",
                  "pm.test('task lookup returns 200', () => pm.response.to.have.status(200));",
                  "const t = pm.response.json();",
                  "const n = Number(pm.environment.get('taskPollCount') || 0) + 1;",
                  "const max = Number(pm.environment.get('taskPollMax') || 60);",
                  "console.log(`task ${t.uuid && t.uuid.uuid} ${t.type} ${t.state} ${t.progressPercent || 0}% try ${n}/${max}`);",
                  "if (!t.jobDone && n < max) {",
                  "  pm.environment.set('taskPollCount', n);",
                  "  postman.setNextRequest(pm.info.requestName);",
                  "} else {",
                  "  pm.environment.set('taskPollCount', 0);",
                  "  pm.environment.unset('taskId');",
                  "  if (t.error) { console.log('TintriError: ' + JSON.stringify(t.error)); }",
                  "  pm.test('task finished with state SUCCESS', () => pm.expect(t.state).to.eql('SUCCESS'));",
                  "}",
                  "}"
                ]
              }
            }
          ]
        }
      ]
    },
    {
      "name": "04 Verify",
      "item": [
        {
          "name": "List user snapshots of the VM",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Cookie",
                "value": "JSESSIONID={{tintriSession}}"
              }
            ],
            "url": "{{baseUrl}}/api/v310/snapshot?vmUuid={{vmUuid}}&type=USER_GENERATED_SNAPSHOT&limit=50"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const retrying = pm.response.code === 401 && [pm.environment.get('retryAfterLogin'), pm.environment.get('retryAfterVcLogin')].includes(pm.info.requestName);",
                  "if (retrying) { console.log('401: retry scheduled after login, assertions deferred'); } else {",
                  "pm.test('200', () => pm.response.to.have.status(200));",
                  "const items = pm.response.json().items || [];",
                  "console.log(items.map(s => `${s.uuid.uuid} ${s.description || ''} ${s.consistency} created ${s.createTime} expires ${s.expirationTime}`).join('\\n'));",
                  "const want = pm.environment.get('snapshotUuid');",
                  "if (want) pm.test('new snapshot is listed', () => pm.expect(items.map(s => s.uuid.uuid)).to.include(want));",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "VM detail (QoS, protection, replication)",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Cookie",
                "value": "JSESSIONID={{tintriSession}}"
              }
            ],
            "url": "{{baseUrl}}/api/v310/vm/{{vmUuid}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const retrying = pm.response.code === 401 && [pm.environment.get('retryAfterLogin'), pm.environment.get('retryAfterVcLogin')].includes(pm.info.requestName);",
                  "if (retrying) { console.log('401: retry scheduled after login, assertions deferred'); } else {",
                  "pm.test('200', () => pm.response.to.have.status(200));",
                  "const v = pm.response.json();",
                  "const q = v.qosConfig || {};",
                  "console.log(`QoS min=${q.minNormalizedIops} max=${q.maxNormalizedIops} effective=${q.effectiveMinNormalizedIops}/${q.effectiveMaxNormalizedIops} inherited=${q.inheritanceEnabled}`);",
                  "const r = v.replication || {};",
                  "console.log(`replication enabled=${r.isEnabled} state=${r.replicationState} outgoing=${(r.configurationsOutgoing || []).length}`);",
                  "if (pm.environment.get('allowWrites') === 'true') {",
                  "  pm.test('QoS matches requested values', () => {",
                  "    pm.expect(q.minNormalizedIops).to.eql(Number(pm.environment.get('qosMin')));",
                  "    pm.expect(q.maxNormalizedIops).to.eql(Number(pm.environment.get('qosMax')));",
                  "  });",
                  "}",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "Replication paths",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Cookie",
                "value": "JSESSIONID={{tintriSession}}"
              }
            ],
            "url": "{{baseUrl}}/api/v310/datastore/{{datastoreId}}/replicationPath"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const retrying = pm.response.code === 401 && [pm.environment.get('retryAfterLogin'), pm.environment.get('retryAfterVcLogin')].includes(pm.info.requestName);",
                  "if (retrying) { console.log('401: retry scheduled after login, assertions deferred'); } else {",
                  "pm.test('200', () => pm.response.to.have.status(200));",
                  "const paths = pm.response.json();",
                  "(Array.isArray(paths) ? paths : []).forEach(p => console.log(`${p.displayName}: ${p.sourceIp} -> ${p.destinationIp}:${p.destinationPort}`));",
                  "}"
                ]
              }
            }
          ]
        }
      ]
    },
    {
      "name": "05 Troubleshoot",
      "item": [
        {
          "name": "New alerts",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Cookie",
                "value": "JSESSIONID={{tintriSession}}"
              }
            ],
            "url": "{{baseUrl}}/api/v310/alert?state=NEW&severity=ALERT&limit=50"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const retrying = pm.response.code === 401 && [pm.environment.get('retryAfterLogin'), pm.environment.get('retryAfterVcLogin')].includes(pm.info.requestName);",
                  "if (retrying) { console.log('401: retry scheduled after login, assertions deferred'); } else {",
                  "pm.test('200', () => pm.response.to.have.status(200));",
                  "const items = pm.response.json().items || [];",
                  "console.log(items.map(a => `${a.notifiedTimestamp} ${a.severity} ${a.source}: ${a.message}`).join('\\n'));",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "Alerts, paginated (v310.191+)",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Cookie",
                "value": "JSESSIONID={{tintriSession}}"
              }
            ],
            "url": "{{baseUrl}}/api/v310/alert/paginated?limit=50"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const retrying = pm.response.code === 401 && [pm.environment.get('retryAfterLogin'), pm.environment.get('retryAfterVcLogin')].includes(pm.info.requestName);",
                  "if (retrying) { console.log('401: retry scheduled after login, assertions deferred'); } else {",
                  "if (pm.response.code === 404) { console.warn('alert/paginated not available: TxOS older than 5.6 (v310.191)'); }",
                  "pm.test('200 or 404 on older TxOS', () => pm.expect(pm.response.code).to.be.oneOf([200, 404]));",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "Recent tasks",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Cookie",
                "value": "JSESSIONID={{tintriSession}}"
              }
            ],
            "url": "{{baseUrl}}/api/v310/task?limit=50"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const retrying = pm.response.code === 401 && [pm.environment.get('retryAfterLogin'), pm.environment.get('retryAfterVcLogin')].includes(pm.info.requestName);",
                  "if (retrying) { console.log('401: retry scheduled after login, assertions deferred'); } else {",
                  "pm.test('200', () => pm.response.to.have.status(200));",
                  "const items = pm.response.json().items || [];",
                  "const bad = items.filter(t => t.state === 'FAILED');",
                  "bad.forEach(t => console.log(`FAILED ${t.type} ${t.uuid.uuid}: ${t.error ? t.error.message : ''}`));",
                  "pm.test('no failed tasks in the recent list', () => pm.expect(bad.length).to.eql(0));",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "Active API sessions",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Cookie",
                "value": "JSESSIONID={{tintriSession}}"
              }
            ],
            "url": "{{baseUrl}}/api/v310/session/active"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const retrying = pm.response.code === 401 && [pm.environment.get('retryAfterLogin'), pm.environment.get('retryAfterVcLogin')].includes(pm.info.requestName);",
                  "if (retrying) { console.log('401: retry scheduled after login, assertions deferred'); } else {",
                  "pm.test('200', () => pm.response.to.have.status(200));",
                  "const s = pm.response.json();",
                  "console.log(`${s.length} sessions: ` + s.map(x => `${x.userName}@${x.clientIp}`).join(', '));",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "Check vCenter registration (no refresh)",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Cookie",
                "value": "JSESSIONID={{tintriSession}}"
              }
            ],
            "url": "{{baseUrl}}/api/v310/datastore/{{datastoreId}}/hypervisorManagerConfig/{{hypervisorManagerId}}?refresh=false"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const retrying = pm.response.code === 401 && [pm.environment.get('retryAfterLogin'), pm.environment.get('retryAfterVcLogin')].includes(pm.info.requestName);",
                  "if (retrying) { console.log('401: retry scheduled after login, assertions deferred'); } else {",
                  "pm.test('200', () => pm.response.to.have.status(200));",
                  "const m = pm.response.json();",
                  "console.log(`${m.host} ping=${m.hypervisorManagerPingStatus}`);",
                  "}"
                ]
              }
            }
          ]
        }
      ]
    },
    {
      "name": "06 Cleanup and logout",
      "item": [
        {
          "name": "[WRITE] Restore original QoS",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Cookie",
                "value": "JSESSIONID={{tintriSession}}"
              }
            ],
            "url": "{{baseUrl}}/api/v310/vm/{{vmUuid}}/qosConfig",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"typeId\": \"com.tintri.api.rest.v310.dto.Request\",\n  \"objectsWithNewValues\": [\n    {\n      \"typeId\": \"com.tintri.api.rest.v310.dto.domain.beans.vm.VirtualMachineQoSConfig\",\n      \"minNormalizedIops\": {{origQosMin}},\n      \"maxNormalizedIops\": {{origQosMax}}\n    }\n  ],\n  \"propertiesToBeUpdated\": [\n    \"minNormalizedIops\",\n    \"maxNormalizedIops\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const retrying = pm.response.code === 401 && [pm.environment.get('retryAfterLogin'), pm.environment.get('retryAfterVcLogin')].includes(pm.info.requestName);",
                  "if (retrying) { console.log('401: retry scheduled after login, assertions deferred'); } else {",
                  "pm.test('QoS restored (204)', () => pm.response.to.have.status(204));",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "[WRITE] Delete test snapshot",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Cookie",
                "value": "JSESSIONID={{tintriSession}}"
              }
            ],
            "url": "{{baseUrl}}/api/v310/snapshot/{{snapshotUuid}}"
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!pm.environment.get('snapshotUuid')) { pm.execution.skipRequest(); }"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const retrying = pm.response.code === 401 && [pm.environment.get('retryAfterLogin'), pm.environment.get('retryAfterVcLogin')].includes(pm.info.requestName);",
                  "if (retrying) { console.log('401: retry scheduled after login, assertions deferred'); } else {",
                  "pm.test('snapshot deleted', () => pm.expect(pm.response.code).to.be.oneOf([200, 204]));",
                  "console.log(pm.response.text());",
                  "pm.environment.unset('snapshotUuid');",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "Logout from VMstore",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Cookie",
                "value": "JSESSIONID={{tintriSession}}"
              }
            ],
            "url": "{{baseUrl}}/api/v310/session/logout"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const retrying = pm.response.code === 401 && [pm.environment.get('retryAfterLogin'), pm.environment.get('retryAfterVcLogin')].includes(pm.info.requestName);",
                  "if (retrying) { console.log('401: retry scheduled after login, assertions deferred'); } else {",
                  "pm.test('logout returns 204', () => pm.response.to.have.status(204));",
                  "pm.environment.unset('tintriSession');",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "Logout from vCenter",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "vmware-api-session-id",
                "value": "{{vcSession}}"
              }
            ],
            "url": "{{vcenterUrl}}/api/session"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const retrying = pm.response.code === 401 && [pm.environment.get('retryAfterLogin'), pm.environment.get('retryAfterVcLogin')].includes(pm.info.requestName);",
                  "if (retrying) { console.log('401: retry scheduled after login, assertions deferred'); } else {",
                  "pm.test('vCenter session deleted (204)', () => pm.response.to.have.status(204));",
                  "pm.environment.unset('vcSession');",
                  "}"
                ]
              }
            }
          ]
        }
      ]
    }
  ]
}
{
  "id": "e95296b8-a829-5c9e-add3-eea40529076b",
  "name": "vmstore01.lab.local + vcenter01.lab.local",
  "values": [
    {
      "key": "baseUrl",
      "value": "https://vmstore01.lab.local",
      "type": "default",
      "enabled": true
    },
    {
      "key": "username",
      "value": "svc-vmstore-api",
      "type": "default",
      "enabled": true
    },
    {
      "key": "password",
      "value": "",
      "type": "secret",
      "enabled": true
    },
    {
      "key": "fullApiVersion",
      "value": "v310.207",
      "type": "default",
      "enabled": true
    },
    {
      "key": "datastoreId",
      "value": "default",
      "type": "default",
      "enabled": true
    },
    {
      "key": "vcenterUrl",
      "value": "https://vcenter01.lab.local",
      "type": "default",
      "enabled": true
    },
    {
      "key": "vcenterUsername",
      "value": "svc-vmstore-api@vsphere.local",
      "type": "default",
      "enabled": true
    },
    {
      "key": "vcenterPassword",
      "value": "",
      "type": "secret",
      "enabled": true
    },
    {
      "key": "vcenterName",
      "value": "vcenter01.lab.local",
      "type": "default",
      "enabled": true
    },
    {
      "key": "vmName",
      "value": "app01",
      "type": "default",
      "enabled": true
    },
    {
      "key": "allowWrites",
      "value": "false",
      "type": "default",
      "enabled": true
    },
    {
      "key": "allowDestructive",
      "value": "false",
      "type": "default",
      "enabled": true
    },
    {
      "key": "snapshotName",
      "value": "api-smoke-test",
      "type": "default",
      "enabled": true
    },
    {
      "key": "snapshotRetentionMinutes",
      "value": "240",
      "type": "default",
      "enabled": true
    },
    {
      "key": "cloneName",
      "value": "app01-apiclone",
      "type": "default",
      "enabled": true
    },
    {
      "key": "qosMin",
      "value": "0",
      "type": "default",
      "enabled": true
    },
    {
      "key": "qosMax",
      "value": "5000",
      "type": "default",
      "enabled": true
    },
    {
      "key": "syncTargetVmUuid",
      "value": "",
      "type": "default",
      "enabled": true
    },
    {
      "key": "syncSnapshotUuid",
      "value": "",
      "type": "default",
      "enabled": true
    },
    {
      "key": "syncDisk",
      "value": "scsi0:1",
      "type": "default",
      "enabled": true
    },
    {
      "key": "taskPollMax",
      "value": "60",
      "type": "default",
      "enabled": true
    },
    {
      "key": "taskPollDelayMs",
      "value": "5000",
      "type": "default",
      "enabled": true
    },
    {
      "key": "tintriSession",
      "value": "",
      "type": "secret",
      "enabled": true
    },
    {
      "key": "vcSession",
      "value": "",
      "type": "secret",
      "enabled": true
    },
    {
      "key": "vmUuid",
      "value": "",
      "type": "default",
      "enabled": true
    },
    {
      "key": "vmMor",
      "value": "",
      "type": "default",
      "enabled": true
    },
    {
      "key": "vmInstanceUuid",
      "value": "",
      "type": "default",
      "enabled": true
    },
    {
      "key": "origQosMin",
      "value": "0",
      "type": "default",
      "enabled": true
    },
    {
      "key": "origQosMax",
      "value": "0",
      "type": "default",
      "enabled": true
    },
    {
      "key": "snapshotUuid",
      "value": "",
      "type": "default",
      "enabled": true
    },
    {
      "key": "taskId",
      "value": "",
      "type": "default",
      "enabled": true
    },
    {
      "key": "taskPollCount",
      "value": "0",
      "type": "default",
      "enabled": true
    },
    {
      "key": "hypervisorManagerId",
      "value": "",
      "type": "default",
      "enabled": true
    }
  ],
  "_postman_variable_scope": "environment"
}

Run it in Postman

  • Import both files, select the environment, set baseUrl, vcenterUrl, username, vcenterUsername, vcenterName and vmName, and type the two passwords into the current value only.
  • If the VMstore or vCenter certificate is not trusted by your machine, add the issuing CA under Settings, Certificates rather than turning off SSL verification globally.
  • Open the Collection Runner, keep the folder order, run. With the defaults you get a read-only health and identity check. Set allowWrites=true for the snapshot, QoS and clone round trip, against a test VM.

Run it with newman

# newman 6.1+ (npm install -g newman). Read-only smoke test, JUnit output for CI.
newman run 22-vmware-vsphere-tintri-vmstore-rest-api-guide.postman_collection.json \
  -e 22-vmware-vsphere-tintri-vmstore-rest-api-guide.postman_environment.json \
  --env-var "baseUrl=https://vmstore01.lab.local" \
  --env-var "vcenterUrl=https://vcenter01.lab.local" \
  --env-var "password=${TINTRI_PASSWORD}" \
  --env-var "vcenterPassword=${VC_PASSWORD}" \
  --env-var "vmName=app01" \
  --ssl-extra-ca-certs /etc/pki/lab-root-ca.pem \
  --timeout-request 60000 \
  -r cli,junit --reporter-junit-export results/vmstore-smoke.xml

# Lab only: skip certificate verification instead of trusting the CA
#   add --insecure   (never in a pipeline that holds production credentials)

# Write round trip against a test VM: snapshot, QoS, clone, verify, clean up
newman run ...collection.json -e ...environment.json \
  --env-var "allowWrites=true" --env-var "vmName=apitest01" --env-var "cloneName=apitest01-clone" \
  --env-var "password=${TINTRI_PASSWORD}" --env-var "vcenterPassword=${VC_PASSWORD}"

# One folder only, for example the troubleshooting checks
newman run ...collection.json -e ...environment.json --folder "01 Auth" --folder "05 Troubleshoot" \
  --folder "06 Cleanup and logout" --env-var "password=${TINTRI_PASSWORD}" --env-var "vcenterPassword=${VC_PASSWORD}"

As a CI smoke test, run the read-only form after every TxOS upgrade, vCenter upgrade, certificate rotation and service-account password rotation; those are exactly the changes that break integrations silently. newman exits non-zero when any assertion fails, so a pipeline step fails without extra glue. The JUnit file shows each pm.test as a test case, which makes “exactly one ACTIVE controller” or “instance_uuid matches the VMstore record” visible in the CI UI. For a nightly run from cron on a jump host:

# /etc/cron.d/vmstore-api-smoke   (runs as a dedicated user; secrets in a root-only env file)
SHELL=/bin/bash
15 6 * * * svc-api . /etc/vmstore-api/secrets.env && cd /opt/vmstore-api && \
  newman run 22-vmware-vsphere-tintri-vmstore-rest-api-guide.postman_collection.json \
  -e 22-vmware-vsphere-tintri-vmstore-rest-api-guide.postman_environment.json \
  --env-var "password=${TINTRI_PASSWORD}" --env-var "vcenterPassword=${VC_PASSWORD}" \
  --ssl-extra-ca-certs /etc/pki/lab-root-ca.pem -r cli,junit \
  --reporter-junit-export "/var/log/vmstore-api/smoke-$(date -u +\%Y\%m\%dT\%H\%M\%SZ).xml" \
  >> /var/log/vmstore-api/smoke.log 2>&1 || logger -t vmstore-api "newman smoke test FAILED"

14. End-to-end workflow

From nothing to a green newman run and one verified write round trip. Each step has the check that proves it worked.

#StepVerify withExpected
1Create a VMstore local or AD account for automation with the Read Only role, and a second with System Admin for writes. Create a vCenter account with read access.VMstore UI user list; GET /v310/session/current after loginRoles shown match what you intended
2Trust the certificates: export the issuing CA for the VMstore and vCenter certificates to a PEM file on the workstation or runner.curl -sS --cacert ca.pem https://vmstore01.lab.local/api/info200 with a RestApi body, no -k
3Read the API versions and set fullApiVersion to the newest one your TxOS supports.GET /api/infosupportedVersionSet contains the version you set
4Run the curl login script from section 04.session/current outputYour user, your role, an expirationTime in the future; logout HTTP 204
5Check health and registration (section 05).operationalStatus, controller, hypervisorManagerConfigisFilesystemUp: true; one ACTIVE and one STANDBY; your vCenter listed as VMWARE
6Run Get-VMstoreVmMap.ps1 with the read-only accounts.The summary tableAll VMs MATCH; investigate anything else before automating
7Import the collection and environment; run read-only with newman.newman summary0 failed assertions; [WRITE] requests listed as skipped
8Pick a test VM, set allowWrites=true and vmName, run again with the write account.newman output; VMstore UISnapshot created and listed, QoS read back equal, clone task SUCCESS, clone visible in vCenter, QoS restored, snapshot deleted
9Delete the clone VM from vCenter (power off, delete from disk).GET /api/vcenter/vm?names=app01-apicloneEmpty list
10Schedule the read-only run (cron or CI) and wire the JUnit output into your alerting.First scheduled runA results XML per run, a syslog line on failure

15. API reference table

Checked against: Tintri REST API v310.207 (TxOS 6.0.3) public reference, and the vSphere Automation API reference on developer.broadcom.com at /latest/ (9.1.2; all calls also present in 9.0). “v310 (pre-v310.101)” means the call predates the oldest supported API version, so it is present on every supported TxOS. VMstore paths are relative to https://<vmstore>/api, vCenter paths to https://<vcenter>.

MethodPathPurposeKey fieldsSince
GET/infoAPI versions, no authpreferredVersion, supportedVersionSetv310 (pre-v310.101)
POST/v310/session/loginLog in, sets JSESSIONIDtypeId RestApiCredentials, username, password, fullApiVersionv310 (pre-v310.101)
GET/v310/session/currentCurrent sessionuserName, roles, expirationTimev310.51
GET/v310/session/activeAll sessionsuserName, clientIp, clientTypev310.51
POST/v310/session/{tintriSessionId}/invalidateEnd a session (Admin)path id from session/activev310.71
POST/v310/session/logoutLog out (204)nonev310 (pre-v310.101); GET form deprecated
GET/v310/appliance/default/infoModel, TxOSmodelName, osVersion, isAllFlashv310 (pre-v310.101)
GET/v310/appliance/default/operationalStatusHealthisFilesystemUp, urgentMessage, restartFlagv310 (pre-v310.101)
GET/v310/appliance/default/controllerControllersrole, state, osVersionv310.31
GET/v310/appliance/default/failedComponentsFailed hardwarelistv310 (pre-v310.101)
GET / POST/v310/datastore/default/hypervisorManagerConfigRead / add vCenter registrationhypervisorType, host, usernamev310.21
PUT/v310/datastore/default/hypervisorManagerConfig/{managerConfigId}Rotate registration credentialsusername, passwordv310.21
GET/v310/datastore/default/hypervisorManagerConfig/{managerId}?refresh=One registration, optional refreshhypervisorManagerPingStatusv310.171
GET/v310/datastore/default/statsSummaryLatest datastore statsspaceUsedPhysicalGiB, spaceRemainingDays, latencyTotalMsv310 (pre-v310.101)
GET/v310/datastore/default/statsRealtime, statsHistoricDatastore time seriessortedStats[]v310 (pre-v310.101)
GET/v310/datastore/default/hostResourcesvCenter compute targets for cloneshostname, typev310 (pre-v310.101)
GET/v310/datastore/default/qosInfoSystem QoS totalstotal minimum IOPS allocatedv310.21
GET/v310/vmList VMs (paged)name, live, limit, offset, nextv310 (pre-v310.101)
GET/v310/vm/{vmId}One VMvmware, qosConfig, snapshot, replication, statv310 (pre-v310.101)
GET/v310/vm/{vmId}/statsRealtime, statsHistoricVM time serieslatency*Ms, operations*Iopsv310 (pre-v310.101)
POST/v310/snapshotManual snapshotslist of SnapshotSpecv310 (pre-v310.101)
GET/v310/snapshotList snapshotsvmUuid, type, limitv310 (pre-v310.101)
GET / DELETE/v310/snapshot/{tintriUuid}Read / delete one snapshotuuidv310 (pre-v310.101)
POST/v310/snapshot/{uuid}/lock, /unlockLock / unlock (DPA role)nonev310.183
PUT/v310/vm/{vmId}/qosConfigPer-VM QoSRequest of VirtualMachineQoSConfigv310.21
PUT/v310/vm/qosConfigBulk QoSMultipleSelectionRequestv310.21
POST/v310/vm/syncSyncVM, returns Tasktype, targetVmTintriUuids, snapshotTintriUuidv310.21
POST/v310/vmClone, returns TaskVirtualMachineCloneSpec, vmware.cloneVmNamev310 (pre-v310.101)
GET/v310/task/{id}Task statusstate, jobDone, progressPercent, errorv310 (pre-v310.101)
GET/v310/datastore/default/replicationPathReplication pathsdestinationIp, destinationPortv310 (pre-v310.101)
POST/v310/datastore/default/testReplicationPathTest a pathTestReplicationPathv310.41
PUT/v310/vm/{vmId}/replicationConfigsPer-VM outgoing replicationlist of VirtualMachineReplicationConfigv310.21
GET/v310/alertAlerts (paged)state, severity, sincev310 (pre-v310.101)
GET/v310/alert/paginatedAlerts, paginated variantlimit, offsetv310.191
PUT/v310/servicegroup/{id}/mountIpService group mount IPstringv310.207
POST/api/session (vCenter)vCenter tokenHTTP BasicvSphere 7.0 (/api); /rest path is legacy
GET/api/vcenter/vm (vCenter)List VMs (max 4000)names, clusters, hosts, power_statesvSphere 7.0 (/api)
GET/api/vcenter/vm/{vm} (vCenter)VM detail with identityidentity.instance_uuid, identity.bios_uuididentity since API 6.7.1
DELETE/api/session (vCenter)End vCenter session (204)vmware-api-session-idvSphere 7.0 (/api)

If you are on older TxOS or older scripts. Replace GET /v310/session/logout with POST; replace PUT /v310/datastore/{uuid}/replicationPath/test with POST /v310/datastore/{uuid}/testReplicationPath; replace POST/PUT/DELETE /v310/vm/{vmId}/replicationConfig and POST /v310/vm/replicationConfig with PUT /v310/vm/{vmId}/replicationConfigs; and on vCenter replace /rest/com/vmware/cis/session with /api/session. A login without fullApiVersion gets v310.1 behaviour.

16. Error shapes and what they mean

The VMstore returns a TintriError body on errors. The shape, from Tintri’s reference:

{
  "typeId": "com.tintri.api.rest.v310.dto.domain.beans.TintriError",
  "code": "ERR-API-8001",
  "message": "Failed to find requested resource of type VirtualMachine with id: 'xxxxddd'",
  "causeDetails": "",
  "title": "Resource not found"
}

vCenter returns its own structure on /api errors: an error_type (for example UNAUTHENTICATED, UNAUTHORIZED, NOT_FOUND, INVALID_ARGUMENT) and a messages list with default_message and id. Log both bodies; the HTTP code alone rarely tells you which of several causes you hit.

HTTPTintri meaning (reference)Typical cause in practiceWhat the admin does
400Request validation failedMissing or wrong typeId; retention not -1 and not above 59 (ERR-API-3105 invalid create snapshot); bad clone spec (ERR-API-3205); unknown query parameter (ERR-API-4003)Compare the body with the DTO for your API version; print the request
401Not authorized, needs a successful loginNo cookie, expired session, session invalidated by an adminLog in again once; if it repeats, check the account is not locked or expired
403Forbidden: invalid credentials or licensesRead Only account doing a write; a licensed feature (Tintri cites /v310/vm/sync) without the licenceUse the write account; check licences on the VMstore
404API not foundWrong path or version prefix; a VM or snapshot UUID that no longer exists (ERR-API-8001); calling a v310.191 endpoint on older TxOSCheck /api/info; re-query the object
405Method not allowedGET where POST is required, for example an old logout script after the GET form is removedUse the method in the reference table
409Conflict: object already existsCreating something that exists (a service group, a path)GET it and reuse it; do not retry the create
500Internal errorClone or snapshot workflow failure (ERR-API-3206, ERR-API-3213, ERR-API-3106), SyncVM failure (ERR-API-3701)Read the task error; check the vCenter registration and VMstore alerts
501Not implementedA VMstore-only call sent to TGC, or the reverseSend it to the right endpoint
503Service unavailable, usually temporaryExternal service such as AD unavailable; snapshot inventory still loading (ERR-API-9013)Retry with back-off

17. Troubleshooting

SymptomLikely causeCheckFix
curl or Postman fails before any HTTP statusTLS: untrusted CA, or a client that cannot do TLS 1.2 (TxOS 5.6.0.1 and later accept only TLS 1.2)openssl s_client -connect vmstore01.lab.local:443 -tls1_2 -brief </dev/nullTrust the issuing CA; upgrade the client runtime; do not fall back to -k in production
Login returns 200, next call returns 401Cookie not sent: header typo, a proxy stripping cookies, or the script not using the session variablePrint request headers; in Postman, the console shows the Cookie headerSend JSESSIONID on every call; bypass the proxy for the VMstore
Calls work for a while, then 401Session expired or invalidatedGET /v310/session/current expirationTime; session/activeRe-login on 401 (the collection does it once); stop leaking sessions
403 on a writeAccount role is Read Only, or the feature needs a licencesession/current rolesUse the System Admin automation account; check licences
404 on a path that is in this guideTxOS older than the “Since” version; or /api missing from the URLGET /api/info; the version matrix in section 01Use the older equivalent or upgrade TxOS
400 on a PUT that looks rightWrong typeId or envelope (Request vs MultipleSelectionRequest), or a property missing from propertiesToBeUpdatedCompare with the DTO page for that callFix the envelope; the server ignores properties not listed
VM list is missing VM names, only filesvCenter registration broken (expired service-account password, DNS)GET .../hypervisorManagerConfig; VMstore alertsRotate the password with the PUT; fix DNS from the VMstore admin network
Mapping script shows NAME_ONLY for everythingThe mor format differs from vCenter’s vm id, or the VMstore reports another vCenter nameDump one VM: jq .items[0].vmwareAdjust the join (strip any prefix) or pass the vCenter name the VMstore reports
Clone task FAILEDvCenter not a COMPUTE_RESOURCE target, name clash, or no spaceGET /v310/task/{id} error; hostResourcesFix the target; pick a unique cloneVmName
SyncVM fails on VDISKDisk identifiers do not exist on source or targetGET /v310/snapshot/{uuid}/disks and the VM’s disksUse the identifiers the snapshot reports
newman shows [WRITE] requests as skippedGuard working as intendedRun log: “SKIP … set allowWrites=true”Set the flag only for test VMs
newman: “pm.execution.skipRequest is not a function”newman older than 6.1.0newman --versionUpgrade newman
vCenter calls 401 after an hour of a long runvCenter session idle-expiredPostman consoleThe collection re-logs in once; split very long runs
Large NFS I/O stalls while the API looks healthyData path problem, not API: MTU black hole or VLAN on the storage pathvmkping -I vmk2 -d -s 8972 <data IP>Fix MTU end to end (section 12, part 2)

18. What’s next

With the session, discovery, identity mapping and the write calls in place, the next steps are scale and operations. The Tintri Global Center API guide does the same across a fleet of VMstores with service groups, and the API-driven troubleshooting guide turns the calls here into symptom playbooks with a correlated vCenter and VMstore timeline. The design guide shows how each design decision becomes one of these API calls, the vSphere Automation REST API deploy guide builds the cluster underneath, and the VCF 9 on Tintri NFS guide does it for VCF. For the conceptual background, go back to part 3 and part 5 of the joint series. On the existing site, the daily Tintri fleet sweep, the vSphere and VMstore latency correlation script and the Tintri PowerShell Core Toolkit 5.1 post are the natural companions if you prefer cmdlets to raw REST.

3 responses

  1. […] Configure the data interface on VLAN 30 with 10.0.30.50 and the MTU you chose (Settings in the VMstore UI, or the VMstore REST API covered in the VMstore API guide). […]

  2. […] POST /v310/snapshot, /v310/vm/{vmId}/statsRealtime and PUT /v310/datastore/{uuid} are VMstoreOnly; see the VMstore API guide […]

  3. […] VMstore-side calls (VMstore REST login, datastore stats, per-VM QoS) are in the VMstore REST API guide, and Tintri Global Center fleet calls in the TGC API guide. VCF 9 domains built through SDDC […]

Leave a Reply