Most Kubernetes-on-vSphere guides end at “the PVC is Bound”. That is where the storage admin’s questions start: which VMDK is this, on which datastore, attached to which node VM, and why is the VMstore showing 40 ms on it? This post follows one persistent volume from the YAML file to the bytes on a Tintri VMstore and back out again. It covers the deploy workflow, every controller and API hop, the packets underneath, the full lifecycle (expand, snapshot, restore, clone, delete) and the API calls that tie a Kubernetes object to a VMstore vDisk, with a Postman collection that runs the whole chain.

Level: advanced  ·  Stack: vSphere 9.0, Kubernetes 1.36, vSphere CSI 3.8.1, Tintri VMstore (REST API v310.207), Cisco UCS and Nexus  ·  Build time: about 3 hours from node VMs to first stateful app


Contents

  1. Scope, versions and what was checked
  2. Deployment architecture
  3. The deploy workflow in seven phases
  4. Prepare vSphere and the Tintri datastore
  5. Install the CSI layer: vanilla, OpenShift, VKS, Tintri CSI
  6. StorageClasses, snapshot classes and a first stateful app
  7. Provisioning, hop by hop
  8. Attach, mount and the pod data path on the wire
  9. Tracing a PV to its VMstore vDisk by API
  10. Lifecycle: expand, snapshot, restore, clone, delete
  11. Option B: the Tintri VMstore CSI driver
  12. API reference table
  13. Error shapes
  14. The Postman collection and newman
  15. End-to-end workflow with verification
  16. Troubleshooting
  17. What’s next

01. Scope, versions and what was checked

This is the build-and-operate companion to the solutions architect’s design guide for Kubernetes on Tintri. That post decides which storage path, which platform and which StorageClasses you need, and why. This one assumes those decisions are made and does the work: install, provision, trace, change and clean up. This post uses the design guide’s labels. Option A is vSphere CSI with CNS volumes, which are VMDKs on a Tintri NFS datastore. Option B is the Tintri VMstore CSI driver, mounting the VMstore over NFS directly from the node VMs. Option C mixes the two in one cluster, using a StorageClass for each. If you have not chosen yet, read the design guide first. Neither driver gives you ReadWriteMany on an NFS datastore: vSphere CSI needs vSAN File Services for RWX, and the Tintri driver supports RWO, ROX and RWOP. Section 11 shows the upstream NFS driver as a hedged RWX variant.

The Tintri REST basics (versions, login, paging, the VM and vDisk objects) are in the VMstore REST API guide, and the vCenter session and VI/JSON patterns are in the API-driven troubleshooting guide. This post uses both without explaining them again.

ComponentVersion used hereWhy this one, and the catch
Kubernetes1.36.71.37.3 is the newest release (kubernetes.io, November 2026). vSphere CSI 3.8.x is tested up to 1.36, so stay on 1.36 for Option A until the compatibility matrix lists 1.37. 1.36 is supported upstream until June 2027.
vSphere CSI driver3.8.1Latest release, a security patch on 3.8.0. 3.8.x supports Kubernetes 1.34 to 1.36. The minimum driver for vSphere 9.0 is 3.6.0.
vSphere CPI1.36 release branchUse the release that matches the Kubernetes minor (1.37.0 is the newest stable CPI). It sets the node providerID that the CSI driver relies on.
external-snapshotterv8.4.0 (as the vSphere script installs it)Upstream is v8.7.1. For Option A, use the version the vSphere CSI snapshot script qualifies and do not mix CRD versions.
Tintri VMstore CSI driverv1.1.0 (August 2025)Option B. Provisioner vmstore.csi.tintri.com, public at github.com/Tintri/vmstore-csi-driver. Needs VMstore 5.6.0.1 or later and privileged pods.
csi-driver-nfsv4.13.6RWX variant only. Upstream NFS CSI driver, provisioner nfs.csi.k8s.io.
vSphere Automation API9.1.2 reference (calls also present in 9.0)/api for VMs, datastores and storage policies; VI/JSON under /sdk/vim25 for First Class Disks.
Tintri VMstore REST APIv310.207Session login with fullApiVersion, /v310/virtualDisk for the per-vDisk view, the Kubernetes view under /v310/datastore/{uuid}/k8s (since v310.171), POST /v310/session/logout.
newman6.2.3Needs 6.1.0 or later for pm.execution.skipRequest(), which the collection uses to keep writes opt-in.

Everything here was checked in December 2026 against kubernetes.io, the vSphere CSI driver source and manifests at tag v3.8.1 on GitHub, the vSphere Container Storage Plug-in documentation on Broadcom TechDocs, the OKD 4.20 storage documentation, the csi-driver-nfs and external-snapshotter repositories, the vSphere Automation API 9.1.2 reference and the public Tintri REST API reference. Manifests were checked against the Kubernetes 1.36 OpenAPI schema, and the Postman collection was run end to end with newman 6.2.3 against a mock of all three APIs. What is not public is called out where it matters.

Two facts shape everything below. On Option A, the vSphere CSI driver does not do PVC-to-PVC cloning (it does not advertise the CSI clone capability), so “clone” means snapshot and restore. And the VMstore’s public QoS is per VM, so every PV attached to a node VM shares that node VM’s QoS settings. The design guide covers what that means for tiering; this post shows how to see it.

02. Deployment architecture

The lab layout matches the rest of the VMware, Tintri and Cisco series, with one VLAN added for the Kubernetes node network. The node VMs run on the same ESXi cluster as everything else, and their persistent volumes are VMDKs on the Tintri NFS datastore, so the storage network is the one you already built: vmk2 on VLAN 30 with jumbo frames, through the UCS fabric interconnects and the Nexus pair to the VMstore data IP.

Admin workstation kubectl · helm · govc Postman / newman 6.2.3 10.0.10.50 · VLAN 10 vCenter Server 9.0 + CNS vcenter01.lab.local /api · /sdk/vim25 · TCP 443 10.0.10.10 · VLAN 10 Kubernetes API (VIP) k8s-api.lab.local:6443 load balancer to 3 CP VMs 10.0.50.10 · VLAN 50 HTTPS 6443 (kubectl, Postman) HTTPS 443 /api/v310 443 Kubernetes cluster · node VMs on pg-k8s-50 (VLAN 50) Control plane VMs cp01-cp03 kube-apiserver · etcd · scheduler vsphere-csi-controller x3: provisioner, attacher, resizer, snapshotter, syncer snapshot-controller + CRDs VolumeSnapshot · Content · Class vSphere CPI (cloud-controller-manager) sets node providerID vsphere://<uuid> Worker VM wk01 kubelet · vsphere-csi-node pod PVSCSI · disk.EnableUUID=TRUE eth0 VLAN 50 · eth1 VLAN 31 (B) Worker VM wk02 kubelet · vsphere-csi-node pod PVSCSI · disk.EnableUUID=TRUE eth0 VLAN 50 · eth1 VLAN 31 (B) Worker VM wk03 kubelet · vsphere-csi-node pod PVSCSI · disk.EnableUUID=TRUE eth0 VLAN 50 · eth1 VLAN 31 (B) CNS API · HTTPS 443 ESXi cluster (vSphere 9.0) runs the node VMs esx01 vmk0 mgmt · VLAN 10 vmk1 vMotion · VLAN 20 vmk2 NFS · VLAN 30 · MTU 9000 NFSv3 mount ds-tintri-01 esx02 vmk0 mgmt · VLAN 10 vmk1 vMotion · VLAN 20 vmk2 NFS · VLAN 30 · MTU 9000 NFSv3 mount ds-tintri-01 esx03 vmk0 mgmt · VLAN 10 vmk1 vMotion · VLAN 20 vmk2 NFS · VLAN 30 · MTU 9000 NFSv3 mount ds-tintri-01 vDS-01 (MTU 9000): pg-mgmt-10 · pg-vmotion-20 · pg-nfs-30 · pg-k8s-50 · pg-nfs-guest-31 (Option B only) UCS FI A end-host · MTU 9216 NFS active UCS FI B end-host · MTU 9216 NFS standby Nexus 9000 A vPC · MTU 9216 VLAN 10-50 trunk Nexus 9000 B vPC · MTU 9216 VLAN 10-50 trunk vPC peer-link TCP 2049 Tintri VMstore vmstore01 Controller A active · B standby Admin IP 10.0.10.40 · VLAN 10 REST /api/v310 · HTTPS 443 Data IP 10.0.30.40 · VLAN 30 NFSv3 TCP 2049 · MTU 9000 export behind ds-tintri-01 Guest NFS IP · VLAN 31 Option B dataIp for node VMs Repl IP 10.0.40.41 · VLAN 40 What the VMstore sees node VMs and their vDisks; a CNS volume is one VMDK (mapping in section 09) B to ESXi: TCP 443, 902 Legend data path (NFS) control / API (HTTPS) standby / failover path replication
Figure 1. Deployment architecture: the admin workstation, vCenter with CNS, the Kubernetes VIP and node VMs, ESXi hosts with the NFS vmkernel port, the UCS and Nexus fabric, and the VMstore interfaces. Option B adds a guest NFS VLAN.
VLANSubnetWhat lives thereWho needs to reach it
10 mgmt10.0.10.0/24vCenter 10.0.10.10, ESXi vmk0 .21 to .24, VMstore admin 10.0.10.40, workstation .50CSI controller pods (to vCenter, TCP 443); vCenter to ESXi (TCP 443, TCP and UDP 902)
20 vMotion10.0.20.0/24vmk1ESXi only
30 NFS10.0.30.0/24vmk2 .21 to .24, VMstore data 10.0.30.40, MTU 9000ESXi only on Option A. The node VMs never touch it.
31 guest NFS10.0.31.0/24Second NIC on node VMs, the VMstore data IP the Tintri CSI driver mounts (dataIp)Option B (and the RWX variant) only
40 replication10.0.40.0/24VMstore replication 10.0.40.41Peer VMstore
50 Kubernetes10.0.50.0/24API VIP 10.0.50.10, cp01 to cp03 .11 to .13, workers .21 and upAdmin workstation and CI (TCP 6443); node VMs out to vCenter (TCP 443)

Two flows are easy to miss when you write the firewall rules. First, the vSphere CSI controller runs on the control-plane nodes and calls vCenter on TCP 443 from VLAN 50, so a rule that only allows the admin workstation to reach vCenter breaks provisioning. Second, the CPI and the CSI node plugin both need vCenter to answer for the node VM’s UUID. That is why the node VM settings in section 04 matter.

03. The deploy workflow in seven phases

Each phase ends with a check that must pass before you start the next one. Most “CSI is broken” tickets come from a phase that was half done: the driver installed before the node VMs had disk.EnableUUID, or a StorageClass that points at a policy matching no datastore.

PhaseWhat you doDone when
1. NetworkVLAN 50 on the vDS and fabric; TCP 443 from VLAN 50 to vCenter; MTU 9000 end to end on VLAN 30vmkping -I vmk2 -d -s 8972 10.0.30.40 succeeds from every host
2. vSphereCNS roles, a service account, a tag-based storage policy matching only ds-tintri-01, node VM settingsPolicy shows exactly one compatible datastore; every node VM has disk.EnableUUID=TRUE, hardware version 15 or later, PVSCSI
3. KubernetesBuild the cluster (kubeadm, Cluster API or your distribution) with the external cloud providerkubectl get nodes shows the nodes, tainted node.cloudprovider.kubernetes.io/uninitialized
4. CPIvSphere cloud-controller-managerTaint gone, spec.providerID set to vsphere://<uuid> on every node
5. CSIvSphere CSI 3.8.1 and the snapshot components (or the platform’s operator)CSIDriver present, controller 3/3, a node pod on every node, CSINode lists the driver
6. ClassesStorageClasses and VolumeSnapshotClassesA test PVC binds, attaches and mounts; a snapshot becomes readyToUse
7. App and traceFirst StatefulSet; trace its PV to the VMstore vDisk; add the newman check to CITrace script prints MATCH and a latency split for the vDisk

04. Prepare vSphere and the Tintri datastore

Node VM requirements

The vSphere CSI driver finds an attached disk inside the guest by its UUID, so every node VM needs disk.EnableUUID=TRUE. It also needs VMware Tools, virtual hardware version 15 or later and a VMware Paravirtual SCSI controller. With four PVSCSI controllers a node VM takes 59 ReadWriteOnce volumes. Build these settings into the template. Changing them on running nodes means a power cycle per node.

# govc, read-only check of one node VM, then the two changes if needed (power the VM off first)
export GOVC_URL=vcenter01.lab.local GOVC_USERNAME="$VC_USER" GOVC_PASSWORD="$VC_PASSWORD"
govc vm.info -e -r wk02 | grep -Ei 'disk.enableuuid|version|scsi'
govc vm.change -vm wk02 -e="disk.enableUUID=1"
govc vm.upgrade -version=15 -vm wk02

Roles, the tag and the storage policy

The driver needs a small set of vCenter privileges, not administrator. The documented roles are: low-level file operations on the datastore (CNS-DATASTORE); add existing disk and add or remove device on the node VMs (CNS-VM); CNS searchable and view storage policies at the vCenter root (CNS-SEARCH-AND-SPBM); and read-only on the datacenter and hosts. The vSAN file-service role is not needed on NFS.

For placement, tag ds-tintri-01 and build a tag-based VM storage policy that matches only that tag. The StorageClass then names the policy, and CNS will only place PVs on datastores the policy matches. A StorageClass with datastoreurl also works, but a policy survives a datastore rename and is what VKS uses anyway. The script below is idempotent and changes node VMs only when you pass -ConfigureNodes.

<#
.SYNOPSIS
  Prepare-K8sOnTintri.ps1: CNS roles, the tintri-gold tag and storage policy, and node VM settings
  for Kubernetes on a Tintri VMstore NFS datastore.
.NOTES
  VCF.PowerCLI 9.x, PowerShell 7.2+. Run once per vCenter. Idempotent: existing objects are reused.
  Secrets: VC_USER and VC_PASSWORD from the environment. Node VMs are changed only with -ConfigureNodes,
  and disk.EnableUUID takes effect after the next power cycle of each node VM.
#>
param(
  [string]$VCenter     = '<VCENTER_FQDN>',
  [string]$Datastore   = 'ds-tintri-01',
  [string]$CsiUser     = 'svc-k8s-csi@vsphere.local',     # the account in csi-vsphere.conf
  [string]$NodeFolder  = '<VM_FOLDER_WITH_NODE_VMS>',
  [string]$Datacenter  = '<DATACENTER_NAME>',
  [switch]$ConfigureNodes
)
$ErrorActionPreference = 'Stop'
$cred = [pscredential]::new($env:VC_USER, (ConvertTo-SecureString $env:VC_PASSWORD -AsPlainText -Force))
Connect-VIServer -Server $VCenter -Credential $cred | Out-Null
try {
  # 1. Roles from the vSphere Container Storage Plug-in documentation (privilege IDs)
  $roles = @{
    'CNS-DATASTORE'        = @('Datastore.FileManagement')
    'CNS-VM'               = @('VirtualMachine.Config.AddExistingDisk', 'VirtualMachine.Config.AddRemoveDevice')
    'CNS-SEARCH-AND-SPBM'  = @('Cns.Searchable', 'StorageProfile.View')
  }
  foreach ($r in $roles.GetEnumerator()) {
    $role = Get-VIRole -Name $r.Key -ErrorAction SilentlyContinue
    if (-not $role) {
      $role = New-VIRole -Name $r.Key -Privilege (Get-VIPrivilege -Id $r.Value)
      Write-Host "created role $($r.Key)"
    }
  }
  $ds     = Get-Datastore -Name $Datastore
  $root   = Get-Folder -NoRecursion        # vCenter root
  $dc     = Get-Datacenter -Name $Datacenter
  $nodes  = Get-Folder -Name $NodeFolder | Get-VM
  New-VIPermission -Entity $ds   -Principal $CsiUser -Role 'CNS-DATASTORE'       -Propagate:$false | Out-Null
  New-VIPermission -Entity $root -Principal $CsiUser -Role 'CNS-SEARCH-AND-SPBM' -Propagate:$false | Out-Null
  New-VIPermission -Entity $dc   -Principal $CsiUser -Role 'ReadOnly'            -Propagate:$false | Out-Null
  foreach ($vm in $nodes) {
    New-VIPermission -Entity $vm -Principal $CsiUser -Role 'CNS-VM' -Propagate:$false | Out-Null
    New-VIPermission -Entity $vm.VMHost -Principal $CsiUser -Role 'ReadOnly' -Propagate:$false -ErrorAction SilentlyContinue | Out-Null
  }

  # 2. Tag the Tintri datastore and build a tag-based VM storage policy that matches only it
  $cat = Get-TagCategory -Name 'k8s-storage' -ErrorAction SilentlyContinue
  if (-not $cat) { $cat = New-TagCategory -Name 'k8s-storage' -Cardinality Single -EntityType Datastore }
  $tag = Get-Tag -Name 'tintri-gold' -Category $cat -ErrorAction SilentlyContinue
  if (-not $tag) { $tag = New-Tag -Name 'tintri-gold' -Category $cat }
  if (-not (Get-TagAssignment -Entity $ds -Category $cat | Where-Object { $_.Tag.Name -eq 'tintri-gold' })) {
    New-TagAssignment -Tag $tag -Entity $ds | Out-Null
  }
  $pol = Get-SpbmStoragePolicy -Name 'tintri-gold' -ErrorAction SilentlyContinue
  if (-not $pol) {
    $rule = New-SpbmRule -AnyOfTags $tag
    $pol  = New-SpbmStoragePolicy -Name 'tintri-gold' -Description 'Kubernetes PVs on the Tintri VMstore' `
              -AnyOfRuleSets (New-SpbmRuleSet -AllOfRules $rule)
  }
  Get-SpbmCompatibleStorage -StoragePolicy $pol | Select-Object Name, Type | Format-Table -AutoSize

  # 3. Node VM prerequisites: disk.EnableUUID, PVSCSI, hardware version
  foreach ($vm in $nodes) {
    $uuid = (Get-AdvancedSetting -Entity $vm -Name 'disk.EnableUUID' -ErrorAction SilentlyContinue).Value
    $ctrl = (Get-ScsiController -VM $vm | Select-Object -ExpandProperty Type) -join ','
    Write-Host ('{0,-12} hw={1,-7} disk.EnableUUID={2,-6} scsi={3}' -f $vm.Name, $vm.HardwareVersion, $uuid, $ctrl)
    if ($ConfigureNodes -and $uuid -ne 'TRUE') {
      if (Get-AdvancedSetting -Entity $vm -Name 'disk.EnableUUID' -ErrorAction SilentlyContinue) {
        Get-AdvancedSetting -Entity $vm -Name 'disk.EnableUUID' | Set-AdvancedSetting -Value 'TRUE' -Confirm:$false | Out-Null
      } else {
        New-AdvancedSetting -Entity $vm -Name 'disk.EnableUUID' -Value 'TRUE' -Confirm:$false | Out-Null
      }
      Write-Host "  set disk.EnableUUID=TRUE on $($vm.Name): power-cycle it in a maintenance window"
    }
  }
}
finally {
  Disconnect-VIServer -Server $VCenter -Confirm:$false
}

Verify the policy through the Automation API, which is what the Postman collection does in folder 02. The response lists every policy; you want tintri-gold and its ID.

GET /api/vcenter/storage/policies HTTP/1.1
Host: vcenter01.lab.local
vmware-api-session-id: <TOKEN>

HTTP/1.1 200 OK
[ { "policy": "<POLICY_ID>", "name": "tintri-gold", "description": "Kubernetes PVs on the Tintri VMstore" }, ... ]
TOKEN=$(curl -sS --cacert "$VC_CA_PEM" -X POST -u "$VC_USER:$VC_PASSWORD" https://vcenter01.lab.local/api/session | tr -d '"')
curl -sS --cacert "$VC_CA_PEM" -H "vmware-api-session-id: $TOKEN" \
  https://vcenter01.lab.local/api/vcenter/storage/policies | jq '.[] | select(.name=="tintri-gold")'
$h = @{ 'vmware-api-session-id' = $token }
Invoke-RestMethod -Uri https://vcenter01.lab.local/api/vcenter/storage/policies -Headers $h |
  Where-Object name -eq 'tintri-gold'

05. Install the CSI layer: vanilla, OpenShift, VKS, Tintri CSI

Where the driver comes from depends on the platform. On vanilla Kubernetes you install it. On OpenShift and on VKS the platform installs it and you only configure it. Option B adds the Tintri driver next to it, on any of the three.

PlatformWho installs vSphere CSINamespaceWhat you configure
Vanilla Kubernetes on VMsYou (manifest)vmware-system-csiSecret vsphere-config-secret, snapshot components, StorageClasses
OpenShift on vSphere (IPI or UPI with the vSphere platform)The cluster storage operatoropenshift-cluster-csi-driversClusterCSIDriver (snapshot limits, volumes per node), StorageClasses; default class thin-csi
VKS (vSphere Kubernetes Service)Supervisor (CNS-CSI) and the guest cluster (pvCSI)Supervisor managedStorage policy on the vSphere Namespace; it becomes a StorageClass plus a -latebinding copy
Any of them, Option BYou (manifest or Helm chart from the Tintri repository)The namespace you set in the manifest (default as shipped)Secret vmstore-csi-file-driver-config, StorageClass with vmstore.csi.tintri.com, snapshot class

Vanilla Kubernetes

The script installs the CPI, writes csi-vsphere.conf into the secret without leaving it on disk, applies the v3.8.1 manifest and runs the snapshot script that ships with the driver. The secret uses ca-file with the vCenter CA rather than insecure-flag = "true". The [Snapshot] section sets the per-volume snapshot limit. The default is 3, and the documentation recommends 2 to 3 on NFS and VMFS because these are vSphere delta-disk snapshots. Each Kubernetes cluster needs its own cluster-id, up to 64 characters. CNS uses it to tell clusters apart when several share one vCenter.

#!/usr/bin/env bash
# install-vsphere-csi.sh: vSphere CPI + vSphere CSI 3.8.1 + snapshot components on vanilla Kubernetes 1.36.
# Run from the admin workstation with cluster-admin kubectl. Secrets: VC_CSI_USER, VC_CSI_PASSWORD.
# VC_CA_PEM points at the PEM file of the CA that signed the vCenter certificate.
set -euo pipefail
K8S_MINOR="${K8S_MINOR:-1.36}"            # must match your cluster minor
CSI_VERSION="${CSI_VERSION:-v3.8.1}"
VCENTER="${VCENTER:-vcenter01.lab.local}"
DATACENTER="${DATACENTER:-<DATACENTER_NAME>}"
CLUSTER_ID="${CLUSTER_ID:-<UNIQUE_CLUSTER_ID>}"   # unique per Kubernetes cluster, at most 64 characters
: "${VC_CSI_USER:?set VC_CSI_USER}" "${VC_CSI_PASSWORD:?set VC_CSI_PASSWORD}" "${VC_CA_PEM:?set VC_CA_PEM}"

# 1. CPI (cloud-controller-manager). Edit the Secret and ConfigMap in the file before applying.
curl -sSLo vsphere-cloud-controller-manager.yaml \
  "https://raw.githubusercontent.com/kubernetes/cloud-provider-vsphere/release-${K8S_MINOR}/releases/v${K8S_MINOR}/vsphere-cloud-controller-manager.yaml"
echo "Edit vsphere-cloud-controller-manager.yaml (vsphere-cloud-secret, vsphere-cloud-config), then press Enter"; read -r
kubectl apply -f vsphere-cloud-controller-manager.yaml
rm -f vsphere-cloud-controller-manager.yaml   # it held credentials

# 2. Namespace and the vsphere-config-secret built from csi-vsphere.conf
kubectl create namespace vmware-system-csi --dry-run=client -o yaml | kubectl apply -f -
umask 077
CONF=$(mktemp -d)/csi-vsphere.conf
cp "$VC_CA_PEM" "$(dirname "$CONF")/vc-ca.pem"
cat > "$CONF" <<CONFEOF
[Global]
cluster-id = "${CLUSTER_ID}"

[VirtualCenter "${VCENTER}"]
insecure-flag = "false"
ca-file = "/etc/cloud/vc-ca.pem"
user = "${VC_CSI_USER}"
password = "${VC_CSI_PASSWORD}"
port = "443"
datacenters = "${DATACENTER}"

[Snapshot]
global-max-snapshots-per-block-volume = 3
CONFEOF
kubectl -n vmware-system-csi create secret generic vsphere-config-secret \
  --from-file=csi-vsphere.conf="$CONF" --from-file=vc-ca.pem="$(dirname "$CONF")/vc-ca.pem" \
  --dry-run=client -o yaml | kubectl apply -f -
rm -rf "$(dirname "$CONF")"

# 3. The driver
kubectl apply -f "https://raw.githubusercontent.com/kubernetes-sigs/vsphere-csi-driver/${CSI_VERSION}/manifests/vanilla/vsphere-csi-driver.yaml"
kubectl -n vmware-system-csi rollout status deployment/vsphere-csi-controller --timeout=10m
kubectl -n vmware-system-csi rollout status daemonset/vsphere-csi-node --timeout=10m

# 4. Snapshot CRDs, snapshot-controller and the qualified csi-snapshotter (script pins the versions it supports)
curl -sSLo deploy-csi-snapshot-components.sh \
  "https://raw.githubusercontent.com/kubernetes-sigs/vsphere-csi-driver/${CSI_VERSION}/manifests/vanilla/deploy-csi-snapshot-components.sh"
bash deploy-csi-snapshot-components.sh

kubectl get csidriver csi.vsphere.vmware.com
kubectl get csinodes

Expected result: a CSIDriver with attachRequired: true and three controller replicas on the control-plane nodes. Each replica is one pod with the provisioner, attacher, resizer, snapshotter, syncer and liveness sidecars. There is also one vsphere-csi-node pod per node.

$ kubectl get csidriver csi.vsphere.vmware.com
NAME                     ATTACHREQUIRED   PODINFOONMOUNT   STORAGECAPACITY   TOKENREQUESTS   REQUIRESREPUBLISH   MODES        AGE
csi.vsphere.vmware.com   true             false            false             <unset>         false               Persistent   4m
$ kubectl -n vmware-system-csi get deploy,ds
NAME                                     READY   UP-TO-DATE   AVAILABLE
deployment.apps/vsphere-csi-controller   3/3     3            3
NAME                              DESIRED   CURRENT   READY
daemonset.apps/vsphere-csi-node   6         6         6

OpenShift

Do not install the upstream manifest on OpenShift. The operator owns the driver, and the version follows the OpenShift release (OKD 4.20 documents 3.5.0, and Red Hat lists 3.6.0 for OpenShift 4.20, so check the release notes for yours). Configuration goes through the ClusterCSIDriver object:

oc get clustercsidriver csi.vsphere.vmware.com -o yaml | grep -A5 driverConfig
# raise the per-volume snapshot limit (keep it low on NFS)
oc patch clustercsidriver/csi.vsphere.vmware.com --type=merge \
  -p '{"spec":{"driverConfig":{"vSphere":{"globalMaxSnapshotsPerBlockVolume":3}}}}'
oc get storageclass thin-csi -o jsonpath='{.parameters}{"\n"}'

The default thin-csi class places volumes on the datastore the installer was given. For a dedicated Tintri tier, create a class with storagepolicyname: tintri-gold exactly as in section 06. The {A(OCP_POST, “stateful OpenShift on Tintri NFS post”)} walks through an OpenShift build on this same stack with a four-layer runbook.

VKS

On VKS there is no CSI secret and no vCenter credential in the guest cluster. The pvCSI driver in the guest calls CNS-CSI in the Supervisor, which talks to vCenter. You assign tintri-gold to the vSphere Namespace, and the guest clusters then see a tintri-gold StorageClass (Immediate binding) and a tintri-gold-latebinding copy (WaitForFirstConsumer). For an NFS datastore the policy must be tag-based, which is the policy the script above builds. The {L(“vsphere-kubernetes-service-tutorial”, “vSphere Kubernetes Service tutorial”)} covers the Supervisor and namespace setup.

Option B: the Tintri VMstore CSI driver

The Tintri driver mounts a folder of the VMstore file system over NFS inside the node VMs, so it needs the guest NFS network in figure 1. Before installing, create the top-level folder on the VMstore and share it over NFS, allow the node IPs to mount it, and make sure the cluster allows privileged pods. Release v1.1.0 supports VMstore 5.6.0.1 and later. Its configuration is one YAML file that maps a name to a VMstore: data IP, management address, file system path, topology zone and API credentials. The file becomes a secret.

# vmstore-csi-file-driver-config.yaml: Tintri VMstore CSI driver v1.1.0 configuration (format from the driver README).
# This file holds a VMstore credential: create the secret from it, then delete the file.
vmstore_map:
  vmstore01:
    mountPoint: /tintri-csi                 # where the driver pods mount the VMstore file system
    dataIp: <VMSTORE_DATA_IP_FOR_NODES>     # an NFS data IP the node VMs can reach (VLAN 31 in figure 1)
    managementAddress: vmstore01.lab.local
    vmstoreFS: /tintri/<CSI_FOLDER>         # top-level folder; must already exist and be shared over NFS
    zone: zone-1
    username: <VMSTORE_CSI_USER>
    password: <VMSTORE_CSI_PASSWORD>
debug: false
git clone -b v1.1.0 https://github.com/Tintri/vmstore-csi-driver.git && cd vmstore-csi-driver
# edit deploy/kubernetes/vmstore-csi-file-driver.yaml: replace "namespace: default" with your driver namespace if needed
kubectl create secret generic vmstore-csi-file-driver-config --from-file=/secure/path/vmstore-csi-file-driver-config.yaml
shred -u /secure/path/vmstore-csi-file-driver-config.yaml
kubectl apply -f deploy/kubernetes/vmstore-csi-file-driver.yaml
kubectl get csidriver vmstore.csi.tintri.com        # ATTACHREQUIRED false
kubectl get pods -o wide | grep vmstore             # controller plus one node pod per node

The repository also has a Helm chart (deploy/helm-chart) and snapshot CRDs with a snapshotter under deploy/kubernetes/snapshots. If you also run Option A in the same cluster, do not apply those CRDs a second time: one set of snapshot CRDs and one snapshot-controller serve every driver. Red Hat’s catalog lists an operator for OpenShift. Use the Tintri CSI driver documentation for your release for anything beyond the README, especially credentials with less than administrator rights.

06. StorageClasses, snapshot classes and a first stateful app

Two StorageClasses cover most needs: a default Delete class, and a Retain class for data you never want removed by a mistyped kubectl delete. Both use WaitForFirstConsumer, so the scheduler picks the node first and the volume is created where it can be attached. Both allow expansion. The snapshot classes mirror them: one deletes the backing snapshot with the VolumeSnapshot, one keeps it.

# tintri-classes.yaml: StorageClasses and VolumeSnapshotClasses for the vSphere CSI path (Option A).
# The storage policy "tintri-gold" is a tag-based VM storage policy that matches only ds-tintri-01 (section 04).
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: tintri-gold
  annotations:
    storageclass.kubernetes.io/is-default-class: "true"
provisioner: csi.vsphere.vmware.com
parameters:
  storagepolicyname: "tintri-gold"
  csi.storage.k8s.io/fstype: "ext4"
reclaimPolicy: Delete
allowVolumeExpansion: true
volumeBindingMode: WaitForFirstConsumer
---
# Same placement, but the FCD survives PVC deletion. Use it for databases you never want removed by a typo.
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: tintri-gold-retain
provisioner: csi.vsphere.vmware.com
parameters:
  storagepolicyname: "tintri-gold"
  csi.storage.k8s.io/fstype: "xfs"
reclaimPolicy: Retain
allowVolumeExpansion: true
volumeBindingMode: WaitForFirstConsumer
---
apiVersion: snapshot.storage.k8s.io/v1
kind: VolumeSnapshotClass
metadata:
  name: tintri-snap
  annotations:
    snapshot.storage.kubernetes.io/is-default-class: "true"
driver: csi.vsphere.vmware.com
deletionPolicy: Delete
---
apiVersion: snapshot.storage.k8s.io/v1
kind: VolumeSnapshotClass
metadata:
  name: tintri-snap-retain
driver: csi.vsphere.vmware.com
deletionPolicy: Retain

The vanilla driver accepts storagepolicyname, datastoreurl and csi.storage.k8s.io/fstype. Use one placement method per class, and no parameters the driver does not know, or the PVC stays Pending.

The first app is a single-replica PostgreSQL StatefulSet. Two details matter for storage. fsGroup makes the kubelet set group ownership on the volume when it is mounted. PGDATA points at a subdirectory, because ext4 puts lost+found at the mount root and initdb refuses a non-empty directory.

# demo-pg.yaml: namespace, credentials secret, headless service and a one-replica PostgreSQL StatefulSet
# whose data volume comes from the tintri-gold StorageClass.
apiVersion: v1
kind: Namespace
metadata:
  name: demo
  labels:
    pod-security.kubernetes.io/enforce: baseline
    pod-security.kubernetes.io/warn: restricted
---
apiVersion: v1
kind: Secret
metadata:
  name: pg-auth
  namespace: demo
type: Opaque
stringData:
  POSTGRES_PASSWORD: "<CHANGE_ME_OR_USE_EXTERNAL_SECRETS>"
---
apiVersion: v1
kind: Service
metadata:
  name: pg
  namespace: demo
spec:
  clusterIP: None
  selector:
    app: pg
  ports:
    - name: postgres
      port: 5432
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: pg
  namespace: demo
spec:
  serviceName: pg
  replicas: 1
  selector:
    matchLabels:
      app: pg
  template:
    metadata:
      labels:
        app: pg
    spec:
      securityContext:
        fsGroup: 999
      containers:
        - name: postgres
          image: postgres:17
          ports:
            - containerPort: 5432
              name: postgres
          env:
            - name: POSTGRES_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: pg-auth
                  key: POSTGRES_PASSWORD
            - name: PGDATA
              value: /var/lib/postgresql/data/pgdata   # subdirectory: ext4 puts lost+found at the mount root
          volumeMounts:
            - name: data
              mountPath: /var/lib/postgresql/data
          readinessProbe:
            exec:
              command: ["pg_isready", "-U", "postgres"]
            periodSeconds: 10
          resources:
            requests:
              cpu: 250m
              memory: 512Mi
  volumeClaimTemplates:
    - metadata:
        name: data
      spec:
        accessModes: ["ReadWriteOnce"]
        storageClassName: tintri-gold
        resources:
          requests:
            storage: 10Gi

The Postman collection and the trace scripts authenticate as a ServiceAccount with only the rights they need: cluster-wide reads on storage objects, and writes only in demo.

# pv-trace-rbac.yaml: a ServiceAccount for Postman/newman and the trace scripts.
# Cluster-wide reads on storage objects; writes only in the demo namespace.
apiVersion: v1
kind: ServiceAccount
metadata:
  name: pv-trace
  namespace: demo
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: pv-trace-read
rules:
  - apiGroups: [""]
    resources: ["persistentvolumes", "nodes"]
    verbs: ["get", "list"]
  - apiGroups: [""]
    resources: ["pods"]
    verbs: ["get", "list"]
  - apiGroups: ["storage.k8s.io"]
    resources: ["storageclasses", "csidrivers", "csinodes", "volumeattachments"]
    verbs: ["get", "list"]
  - apiGroups: ["snapshot.storage.k8s.io"]
    resources: ["volumesnapshotclasses"]
    verbs: ["get", "list"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: pv-trace-read
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: pv-trace-read
subjects:
  - kind: ServiceAccount
    name: pv-trace
    namespace: demo
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: pv-trace-write
  namespace: demo
rules:
  - apiGroups: [""]
    resources: ["persistentvolumeclaims", "pods"]
    verbs: ["get", "list", "create", "patch", "delete"]
  - apiGroups: [""]
    resources: ["events"]
    verbs: ["get", "list"]
  - apiGroups: ["snapshot.storage.k8s.io"]
    resources: ["volumesnapshots"]
    verbs: ["get", "list", "create", "delete"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: pv-trace-write
  namespace: demo
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: Role
  name: pv-trace-write
subjects:
  - kind: ServiceAccount
    name: pv-trace
    namespace: demo
kubectl apply -f pv-trace-rbac.yaml
kubectl -n demo create token pv-trace --duration=8h     # paste into the k8sToken secret variable, never into a file
kubectl auth can-i create persistentvolumeclaims -n demo --as=system:serviceaccount:demo:pv-trace   # yes
kubectl auth can-i delete persistentvolumes --as=system:serviceaccount:demo:pv-trace               # no

07. Provisioning, hop by hop

Figure 2 shows what happens between kubectl apply and a running pod with a mounted volume. Read it in three phases. Provisioning creates the disk, attach connects it to a VM, and mount makes it a filesystem in the pod. Each phase is driven by a different controller watching a different object, so each one fails differently.

kubectl / CI user or GitOps kube-apiserver + scheduler, KCM CSI sidecars provisioner attacher vSphere CSI controller plugin vCenter + CNS FCD · SPBM ESXi host runs wk02 VMstore NFS data IP kubelet (wk02) vsphere-csi-node PROVISION POST /api/v1/namespaces/demo/persistentvolumeclaims → 201, Pending 1 POST pod pg-0 (StatefulSet) that mounts the PVC 2 3 scheduler picks wk02 → PVC annotation volume.kubernetes.io/selected-node=wk02 watch: PVC event 4 gRPC CreateVolume(name=pvc-…, 10Gi, topology) 5 CNS CreateVolume: policy tintri-gold, HTTPS 443 6 create FCD (VMDK) on ds-tintri-01 7 NFSv3 CREATE / WRITE, TCP 2049 8 CNS task success → volume ID = FCD ID 9 loop: poll CNS task CreateVolumeResponse volume_id 10 POST /api/v1/persistentvolumes (csi.volumeHandle) → PVC Bound 11 ATTACH 12 attach/detach controller: POST storage.k8s.io/v1 VolumeAttachment (wk02) watch: VolumeAttachment 13 ControllerPublishVolume(node wk02) 14 CNS AttachVolume(FCD → node VM) 15 reconfigure VM: hot-add disk on PVSCSI 16 open VMDK over NFS 17 PATCH VolumeAttachment status.attached=true 18 MOUNT pod pg-0 on wk02, volume attached (kubelet watch) 19 20 NodeStageVolume: /dev/sdX by disk UUID, mkfs ext4, mount 21 NodePublishVolume: bind mount into pod PATCH pod status → Running 22 Failure branches at 5-6: no datastore matches the storage policy, or the account lacks CNS privileges → PVC stays Pending, event ProvisioningFailed at 14-16: node VM at its PVSCSI volume limit (59), FCD still attached to another node, or vCenter unreachable → VolumeAttachment attachError, pod ContainerCreating at 20: disk.EnableUUID not TRUE, so no /dev/disk/by-id match → MountVolume.MountDevice failed in pod events retries are safe: the CSI spec makes CreateVolume idempotent by name, so a retried step 5 returns the same volume, not a second one Legend: call / NFS I/O response object written / state reached failure branch All vCenter calls HTTPS 443; data on TCP 2049
Figure 2. PVC provisioning, attach and mount on Option A: every controller and API hop from kubectl to the VMstore, with the failure branches.

Provision (steps 1 to 11)

The PVC is created Pending. With WaitForFirstConsumer nothing happens until a pod that uses it is scheduled. The scheduler then writes the chosen node into the PVC annotation volume.kubernetes.io/selected-node. The external-provisioner sidecar sees the annotation and calls the driver’s CreateVolume over the local gRPC socket. The name is pvc-<uid>, which makes the call idempotent: a retry finds the existing volume instead of creating a second one. The driver calls CNS in vCenter with the storage policy. CNS picks a compatible datastore and creates a First Class Disk, which is a VMDK with its own identity that lives outside any VM. It also stores the PVC name, namespace and cluster ID as metadata on the volume. On a Tintri NFS datastore, “create a VMDK” means the ESXi host CNS chose issues NFS CREATE and WRITE calls to the VMstore. The CNS volume ID (the FCD ID) comes back as the CSI volume ID, and the provisioner writes a PV with spec.csi.volumeHandle set to it. The PVC goes Bound.

The PV also gets the finalizer external-provisioner.volume.kubernetes.io/finalizer next to kubernetes.io/pv-protection. Since Kubernetes 1.31, that finalizer makes the provisioner honour the reclaim policy even if the PV is deleted before the PVC, so deleting objects in the “wrong” order no longer leaks a disk on the datastore.

Attach (steps 12 to 18)

The attach/detach controller in kube-controller-manager creates a VolumeAttachment for the PV and node. The external-attacher sidecar calls ControllerPublishVolume, and the driver asks CNS to attach the FCD to the node VM. vCenter reconfigures the VM through the ESXi host it runs on: a hot-add of an existing disk on a PVSCSI controller. This is why the CNS-VM role needs “add existing disk”. When the task succeeds, the attacher sets status.attached=true.

Mount (steps 19 to 22)

The kubelet on wk02 now sees an attached volume for a pod it must start. NodeStageVolume finds the new SCSI disk by its UUID (this is what disk.EnableUUID enables), formats it if it is empty and mounts it at a global staging path. NodePublishVolume bind-mounts that path into the pod. Then the kubelet applies fsGroup ownership and starts the container.

$ kubectl -n demo get events --field-selector involvedObject.name=data-pg-0 -o custom-columns=REASON:.reason,MESSAGE:.message
REASON                  MESSAGE
WaitForFirstConsumer    waiting for first consumer to be created before binding
ExternalProvisioning    Waiting for a volume to be created either by the external provisioner 'csi.vsphere.vmware.com' or manually by the system administrator...
Provisioning            External provisioner is provisioning volume for claim "demo/data-pg-0"
ProvisioningSucceeded   Successfully provisioned volume pvc-7f3c2a10-1b2c-4d5e-8f90-a1b2c3d4e5f6
$ kubectl -n demo get events --field-selector involvedObject.name=pg-0 | grep -E 'Attach|Mount'
Normal  SuccessfulAttachVolume  pod/pg-0  AttachVolume.Attach succeeded for volume "pvc-7f3c2a10-..."

08. Attach, mount and the pod data path on the wire

Figure 3 puts the same flows on the network. Lane A is the attach control path, which is HTTPS from the controller pod to vCenter and from vCenter to the ESXi host. Lane B is the path of one write from the pod. Lane C is Option B (and the RWX variant), where the node VM itself speaks NFS.

A. Attach control path (once per attach, all HTTPS on the management side) CSI controller pod on cp01, VLAN 50 10.0.50.11 → :443 A1 vCenter + CNS AttachVolume task 10.0.10.10, VLAN 10 A2 vCenter → esx02 TCP 443 and 902 to vmk0 10.0.10.22 A3 esx02 reconfigures wk02: hot-add disk on PVSCSI 0:N A4 VMDK opened over NFS via vmk2 → 10.0.30.40:2049 A5 kubelet on wk02 NodeStage: mkfs, mount, bind to pod A6 blocked 443/902: host Not Responding, attach times out B. Data path for one write from a pod, CNS volume on the Tintri NFS datastore (Option A) pod write() to /var/lib/pgdata bind mount B1 ext4 on /dev/sdb inside wk02 no VLAN, no IP B2 PVSCSI vHBA SCSI WRITE to virtual disk 0:1 B3 FCD VMDK on ds-tintri-01 one .vmdk per PV B4 ESXi NFS client NFSv3 WRITE TCP 2049 B5 vmk2 10.0.30.22 pg-nfs-30, MTU 9000 untagged in host B6 vDS uplink adds 802.1Q tag 30 active: vmnic0 B7 VIC vNIC A fabric A, MTU 9000 QoS class MTU 9216 B8 UCS FI A end-host mode VLAN 30 allowed B9 Nexus 9000 A vPC member port MTU 9216, VLAN 30 B10 VMstore data port controller A tag per array config B11 VMstore data IP 10.0.30.40:2049 vDisk I/O counted B12 standby: vNIC B → FI B → Nexus B (failover order, no LACP to FIs) MTU black hole: one hop left at 1500 → large NFS writes stall C. Direct NFS from the node VM (Option B: Tintri CSI driver; RWX variant: csi-driver-nfs) pod write() volume file (Tintri CSI) or subdir (RWX) C1 NFS client in wk02 nfsvers=3 or 4.1 mount by kubelet C2 eth1 10.0.31.22 pg-nfs-guest-31 guest MTU = path C3 vDS uplink adds tag 31 same fabric A/B C4 FI → Nexus VLAN 31 allowed end to end C5 VMstore NFS IP VLAN 31, TCP 2049 export ACL: nodes C6 access denied: node IP not in export Where the tags, MTU and ports sit · Frames are untagged inside the VM and the ESXi host; the vDS adds the VLAN tag on the uplink (VST). · MTU must match on vmk2, the vDS, the VIC vNIC and UCS QoS class, the Nexus ports and the VMstore data port. · Option A data never touches the Kubernetes node network: the node VM only sees a SCSI disk. · Option B puts NFS inside the guest: node VMs need a NIC on the NFS VLAN and must be in the export ACL. · NFSv3 uses TCP 2049 for data; mountd and rpcbind ports also apply to v3 mounts from Linux guests. · NFSv4.1 needs only TCP 2049. Check which versions your TxOS release serves to non-ESXi clients. Legend data path (NFS / SCSI) control / API (HTTPS) standby / failover path where packets are dropped
Figure 3. Packet flow: (A) the attach control path, (B) one pod write through a CNS volume on the Tintri NFS datastore, (C) direct NFS from a node VM on Option B. Amber marks show where packets get dropped.

The important point is lane B. On Option A the pod’s write never crosses the Kubernetes node network. Inside the node VM it is a SCSI write to a virtual disk. The ESXi host turns it into an NFSv3 WRITE on vmk2, and the vDS tags it with VLAN 30 on the uplink. It then goes out on vNIC A, through fabric interconnect A and the Nexus to the VMstore data IP. So the MTU, VLAN and failover checks from {L(“vmware-tintri-cisco-part-2-network-design”, “the network design post”)} are the checks for Kubernetes volumes too. A single hop left at MTU 1500 stalls large writes from every pod on every node behind that host. The {A(“https://vmwareblogs.co.in/2026/08/16/automating-the-jumbo-frame-check-vmkping-across-every-esxi-host/&#8221;, “jumbo frame check”)} finds it in a minute.

Lane A explains the most common attach failure that is not a Kubernetes problem. If vCenter cannot reach the host on TCP 443 and 902 (or the UDP 902 heartbeat is blocked, so the host shows Not Responding), the CNS attach task never completes, and the pod waits in ContainerCreating with an attach timeout. Check the host’s connection state in vCenter before you read CSI logs.

Lane C needs a node NIC on the guest NFS VLAN and node IPs in the export ACL. NFSv3 from Linux also uses rpcbind and mountd; NFSv4.1 needs only TCP 2049.

09. Tracing a PV to its VMstore vDisk by API

The question “which disk on the array is this PVC?” has a precise answer, and it takes four lookups across three APIs. Figure 4 shows the sequence the Postman collection and both trace scripts follow.

newman / script Postman, pwsh, Python kube-apiserver Bearer token · :6443 vCenter /api vmware-api-session-id vCenter /sdk/vim25 VI/JSON, same token VMstore /api/v310 JSESSIONID cookie POST /api/session (Authorization: Basic) 1 201 “token” → header vmware-api-session-id 2 POST /api/v310/session/login {typeId, username, password, fullApiVersion} 3 200 + Set-Cookie JSESSIONID (no bearer token) 4 GET /api/v1/namespaces/demo/persistentvolumeclaims/data-pg-0 5 spec.volumeName = pvc-7f3c…, status.phase = Bound 6 GET /api/v1/persistentvolumes/{pv} → spec.csi.volumeHandle = FCD ID 7 GET /apis/storage.k8s.io/v1/volumeattachments → nodeName wk02, attached 8 GET /api/vcenter/vm?names=wk02 → vm-2041; GET /api/vcenter/datastore?names=… 9 GET /api/vcenter/vm/vm-2041 → disks{}.backing.vmdk_file 10 GET /sdk/vim25/{release}/ServiceInstance/ServiceInstance/content 11 POST …/VcenterVStorageObjectManager/{moId}/RetrieveVStorageObject 12 config.backing.filePath = “[ds-tintri-01] <folder>/<file>.vmdk” 13 script: the FCD filePath must equal one vmdk_file on wk02, else stop GET /api/v310/virtualDisk?vmName=wk02 (or /datastore/default/k8s/pv?pvName=…, v310.171+) 14 GET /api/v310/virtualDisk/{vmUuid}/{vdiskUuid}/statsRealtime 15 PATCH …/persistentvolumeclaims/data-pg-0 (merge-patch: storage 20Gi) 16 GET …/persistentvolumeclaims/data-pg-0 until status.capacity = 20Gi 17 loop: poll every 5 s, max 60 tries POST /api/v310/session/logout → 204 18 DELETE /api/session → 204 19 Branches 401 on any call: the session expired. Log in again (step 1 or 3) once and retry; a second 401 is a credential or RBAC problem, stop. 404 at 7: the PVC is not bound yet (volumeName empty). 403 from kube-apiserver: the ServiceAccount lacks get/list on that resource. 409 AlreadyExists on a create (PVC, VolumeSnapshot): the object is there from an earlier run. GET it instead of creating it again. Legend: request (HTTPS) response / session handoff logout paths relative to https://host; VMstore and vCenter on 443, Kubernetes on 6443
Figure 4. The API calls that map a PVC to its First Class Disk, its VMDK file, its node VM and the VMstore vDisk, with session handling, the expansion poll and the error branches.
  1. Kubernetes: PVC spec.volumeName gives the PV. The PV’s spec.csi.volumeHandle is the FCD ID. The VolumeAttachment for that PV gives the node.
  2. vCenter VI/JSON: RetrieveVStorageObject on the vStorageObjectManager, with the FCD ID and the datastore, returns config.backing.filePath, the VMDK path such as [ds-tintri-01] <folder>/<file>.vmdk.
  3. vCenter /api: the node VM’s disks{}.backing.vmdk_file must contain that same path. This cross-check proves the volume is attached where Kubernetes says it is.
  4. VMstore: GET /v310/virtualDisk?vmName=<node> lists the vDisks the VMstore attributes to the node VM. The one whose path ends in the same file name is the PV. Its statsRealtime gives the latency split.

Step 1: Kubernetes

GET /api/v1/namespaces/demo/persistentvolumeclaims/data-pg-0 HTTP/1.1
Host: k8s-api.lab.local:6443
Authorization: Bearer <SA_TOKEN>

HTTP/1.1 200 OK
{ "kind": "PersistentVolumeClaim", "spec": { "volumeName": "pvc-7f3c2a10-1b2c-4d5e-8f90-a1b2c3d4e5f6", ... },
  "status": { "phase": "Bound", "capacity": { "storage": "10Gi" } } }

GET /api/v1/persistentvolumes/pvc-7f3c2a10-1b2c-4d5e-8f90-a1b2c3d4e5f6 HTTP/1.1
...
{ "spec": { "csi": { "driver": "csi.vsphere.vmware.com", "volumeHandle": "<FCD_ID>", "fsType": "ext4" },
            "persistentVolumeReclaimPolicy": "Delete" } }
K=https://k8s-api.lab.local:6443; T="$K8S_TOKEN"
PV=$(curl -sS --cacert k8s-ca.pem -H "Authorization: Bearer $T" $K/api/v1/namespaces/demo/persistentvolumeclaims/data-pg-0 | jq -r .spec.volumeName)
curl -sS --cacert k8s-ca.pem -H "Authorization: Bearer $T" $K/api/v1/persistentvolumes/$PV | jq -r .spec.csi.volumeHandle
curl -sS --cacert k8s-ca.pem -H "Authorization: Bearer $T" $K/apis/storage.k8s.io/v1/volumeattachments |
  jq -r --arg pv "$PV" '.items[] | select(.spec.source.persistentVolumeName==$pv) | "\(.spec.nodeName) attached=\(.status.attached)"'
$h  = @{ Authorization = "Bearer $env:K8S_TOKEN" }
$k  = 'https://k8s-api.lab.local:6443'
$pv = (Invoke-RestMethod "$k/api/v1/namespaces/demo/persistentvolumeclaims/data-pg-0" -Headers $h).spec.volumeName
(Invoke-RestMethod "$k/api/v1/persistentvolumes/$pv" -Headers $h).spec.csi.volumeHandle
(Invoke-RestMethod "$k/apis/storage.k8s.io/v1/volumeattachments" -Headers $h).items |
  Where-Object { $_.spec.source.persistentVolumeName -eq $pv } | ForEach-Object { $_.spec.nodeName }

Step 2: the First Class Disk in vCenter

CNS has no REST endpoint under /api. Its native API is SOAP in the vSAN namespace, which is what govc uses. The FCD behind a CNS volume, though, is a normal vSphere object, and the VI/JSON API reaches it with the same session token as /api from vSphere 8.0 U3. Read the manager’s reference from the service content instead of hard-coding it, then call RetrieveVStorageObject. The {release} segment must be one your vCenter serves. The examples use 9.0.0.0, as in the troubleshooting guide.

GET /sdk/vim25/9.0.0.0/ServiceInstance/ServiceInstance/content HTTP/1.1
Host: vcenter01.lab.local
vmware-api-session-id: <TOKEN>

HTTP/1.1 200 OK
{ ..., "vStorageObjectManager": { "_typeName": "ManagedObjectReference", "type": "VcenterVStorageObjectManager", "value": "<MOID>" }, ... }

POST /sdk/vim25/9.0.0.0/VcenterVStorageObjectManager/<MOID>/RetrieveVStorageObject HTTP/1.1
Content-Type: application/json
vmware-api-session-id: <TOKEN>

{ "id": { "_typeName": "ID", "id": "<FCD_ID>" },
  "datastore": { "_typeName": "ManagedObjectReference", "type": "Datastore", "value": "datastore-12" } }

HTTP/1.1 200 OK
{ "_typeName": "VStorageObject",
  "config": { "id": { "id": "<FCD_ID>" }, "name": "pvc-7f3c2a10-...", "capacityInMB": 10240,
              "backing": { "_typeName": "BaseConfigInfoDiskFileBackingInfo", "filePath": "[ds-tintri-01] <folder>/<file>.vmdk", ... } } }
SC=$(curl -sS --cacert "$VC_CA_PEM" -H "vmware-api-session-id: $TOKEN" https://vcenter01.lab.local/sdk/vim25/9.0.0.0/ServiceInstance/ServiceInstance/content)
M=$(jq -r '.vStorageObjectManager | "\(.type)/\(.value)"' <<<"$SC")
curl -sS --cacert "$VC_CA_PEM" -H "vmware-api-session-id: $TOKEN" -H 'Content-Type: application/json' -X POST \
  --data "{\"id\":{\"_typeName\":\"ID\",\"id\":\"$FCD\"},\"datastore\":{\"_typeName\":\"ManagedObjectReference\",\"type\":\"Datastore\",\"value\":\"datastore-12\"}}" \
  "https://vcenter01.lab.local/sdk/vim25/9.0.0.0/$M/RetrieveVStorageObject" | jq -r .config.backing.filePath

# the govc equivalent, through the CNS API
govc volume.ls -json "$FCD" | jq -r '.volume[].backingObjectDetails.backingDiskPath'
govc disk.ls -l -L "$FCD"

If you do not know the datastore, the scripts below try each NFS datastore; a wrong one returns a harmless NotFound fault.

Step 3: the VMstore view

The VMstore sees VMDK files, not Kubernetes objects. It attributes files to VMs from the vCenter it is registered with. GET /v310/virtualDisk (VMstore only, paged, filterable by vmName, vmUuid, path and others) returns VirtualDisk objects with name, path, vmName, isSynthetic and the IDs you need for per-vDisk statistics.

GET /api/v310/virtualDisk?vmName=wk02&limit=200 HTTP/1.1
Host: vmstore01.lab.local
Cookie: JSESSIONID=<SESSION>
Accept: application/json

HTTP/1.1 200 OK
{ "typeId": "com.tintri.api.rest.v310.dto.Page", "filteredTotal": 3, "items": [
  { "typeId": "com.tintri.api.rest.v310.dto.domain.VirtualDisk", "name": "<file>.vmdk", "path": "<folder>/<file>.vmdk",
    "vmName": "wk02", "isSynthetic": false, "uuid": { "uuid": "<VDISK_ID>" }, "vmUuid": { "uuid": "<VM_ID>" }, ... }, ... ] }

GET /api/v310/virtualDisk/<VM_ID>/<VDISK_ID>/statsRealtime HTTP/1.1
...
curl -sS --cacert "$TINTRI_CA_PEM" -b jar -c jar "https://vmstore01.lab.local/api/v310/virtualDisk?vmName=wk02&limit=200" |
  jq -r '.items[] | [.name, .path, .uuid.uuid, .vmUuid.uuid] | @tsv'
(Invoke-RestMethod "https://vmstore01.lab.local/api/v310/virtualDisk?vmName=wk02&limit=200" -WebSession $ts).items |
  Select-Object name, path, @{n='vdisk';e={$_.uuid.uuid}}, @{n='vm';e={$_.vmUuid.uuid}}

Confirm the path format once on your release. The public reference documents path as folder/virtualMachineName/virtualDisk.vmdk for NFS, written for VM-owned disks. An FCD lives in its own folder on the datastore, and whether a given TxOS release lists it under the node VM it is attached to, as a synthetic disk, or both, is not in the public reference. The scripts match on the file name only and print every candidate, so you can see what your VMstore reports. A detached FCD (a Retain PV with no pod) has no node VM to filter by. Search with ?path= or page through without vmName.

Shortcut: the VMstore’s own Kubernetes view

From API v310.171 the VMstore can hold a Kubernetes cluster registration. It is a hypervisorManagerConfig of type K8S with a k8sConfig (API endpoint, CA certificate, and a client certificate and key). Once a cluster is registered, GET /v310/datastore/{uuid}/k8s/pv, /pvc, /pod, /namespace, /deployment and /container return Kubernetes objects as the VMstore sees them. The PersistentVolume object carries vdUuid (“the virtual disk that corresponds to this persistent volume”), vmName, vmTintriUuid, nodeName, pvcName and pvcNamespace, and you can filter with pvName, pvcName, namespace or nodeName. That is the whole trace in one call, done by the array.

GET /api/v310/datastore/default/k8s/pv?pvName=pvc-7f3c2a10-1b2c-4d5e-8f90-a1b2c3d4e5f6 HTTP/1.1
Host: vmstore01.lab.local
Cookie: JSESSIONID=<SESSION>

HTTP/1.1 200 OK
{ "typeId": "com.tintri.api.rest.v310.dto.Page", "items": [
  { "typeId": "com.tintri.api.rest.v310.dto.domain.beans.k8s.PersistentVolume", "name": "pvc-7f3c2a10-...",
    "pvcName": "data-pg-0", "pvcNamespace": "demo", "clusterName": "<CLUSTER>", "nodeName": "wk02", "vmName": "wk02",
    "vdUuid": "<VDISK_ID>", "vmTintriUuid": "<VM_ID>", "storageClassName": "tintri-gold", "statusPhase": "Bound", ... } ] }
curl -sS --cacert "$TINTRI_CA_PEM" -b jar "https://vmstore01.lab.local/api/v310/datastore/default/k8s/pv?pvName=$PV" |
  jq -r '.items[] | "\(.pvcNamespace)/\(.pvcName) node=\(.nodeName) vdUuid=\(.vdUuid) vm=\(.vmTintriUuid)"'
(Invoke-RestMethod "https://vmstore01.lab.local/api/v310/datastore/default/k8s/pv?pvName=$pv" -WebSession $ts).items |
  Select-Object pvcNamespace, pvcName, nodeName, vdUuid, vmTintriUuid

Registration is a write on the VMstore and needs a Kubernetes identity that can read the cluster. Follow the Tintri documentation for your release for the supported procedure and the RBAC it needs. The public reference documents the objects but not which CSI drivers’ volumes are mapped. Until you have checked, use the vCenter route above as the source of truth and the Kubernetes view as a cross-check. The Postman collection calls it in folder 04 and carries on if it returns nothing.

The full trace, in Bash and in PowerShell

Both scripts are read-only. They use one vCenter token for both APIs, keep the VMstore session in a cookie jar or web session, and log out of both even on failure. Credentials come from environment variables, and TLS is verified against the CA files you supply.

#!/usr/bin/env bash
# trace-pv.sh: PVC -> PV -> CNS volume (FCD) -> VMDK -> node VM -> Tintri VMstore vDisk and its latency.
# Read-only. Needs kubectl (current context = the cluster), curl, jq.
# Secrets: VC_USER, VC_PASSWORD, TINTRI_USER, TINTRI_PASSWORD. CA bundles: VC_CA_PEM, TINTRI_CA_PEM.
set -euo pipefail
NS="${1:?usage: trace-pv.sh <namespace> <pvc>}"; PVC="${2:?usage: trace-pv.sh <namespace> <pvc>}"
VC="${VCENTER:-vcenter01.lab.local}"; VMSTORE="${VMSTORE:-vmstore01.lab.local}"
REL="${VI_RELEASE:-9.0.0.0}"; TAPI="${TINTRI_API:-v310.207}"

# --- Kubernetes side
PV=$(kubectl -n "$NS" get pvc "$PVC" -o jsonpath='{.spec.volumeName}')
[ -n "$PV" ] || { echo "PVC $NS/$PVC is not bound"; exit 1; }
DRIVER=$(kubectl get pv "$PV" -o jsonpath='{.spec.csi.driver}')
[ "$DRIVER" = csi.vsphere.vmware.com ] || { echo "PV $PV uses $DRIVER, not the vSphere CSI driver"; exit 1; }
FCD=$(kubectl get pv "$PV" -o jsonpath='{.spec.csi.volumeHandle}')
NODE=$(kubectl get volumeattachments -o json |
       jq -r --arg pv "$PV" '.items[] | select(.spec.source.persistentVolumeName==$pv and .status.attached) | .spec.nodeName' | head -1)
echo "PVC $NS/$PVC -> PV $PV -> FCD $FCD -> node ${NODE:-<not attached>}"

# --- vCenter: one token for /api and /sdk/vim25
VCURL=(curl -sS --fail-with-body --cacert "$VC_CA_PEM" -H 'Accept: application/json')
TOKEN=$("${VCURL[@]}" -X POST -u "$VC_USER:$VC_PASSWORD" "https://$VC/api/session" | tr -d '"')
H=(-H "vmware-api-session-id: $TOKEN")
trap '"${VCURL[@]}" "${H[@]}" -X DELETE "https://$VC/api/session" >/dev/null || true' EXIT
SC=$("${VCURL[@]}" "${H[@]}" "https://$VC/sdk/vim25/$REL/ServiceInstance/ServiceInstance/content")
VSOM_T=$(jq -r .vStorageObjectManager.type <<<"$SC"); VSOM_V=$(jq -r .vStorageObjectManager.value <<<"$SC")
FILE=""
for DS in $("${VCURL[@]}" "${H[@]}" "https://$VC/api/vcenter/datastore?types=NFS&types=NFS41" | jq -r '.[].datastore'); do
  BODY=$(jq -n --arg id "$FCD" --arg ds "$DS" \
    '{id:{_typeName:"ID",id:$id}, datastore:{_typeName:"ManagedObjectReference",type:"Datastore",value:$ds}}')
  if OUT=$("${VCURL[@]}" "${H[@]}" -H 'Content-Type: application/json' -X POST --data "$BODY" \
           "https://$VC/sdk/vim25/$REL/$VSOM_T/$VSOM_V/RetrieveVStorageObject" 2>/dev/null); then
    FILE=$(jq -r '.config.backing.filePath' <<<"$OUT")
    echo "FCD $(jq -r .config.name <<<"$OUT") $(jq -r .config.capacityInMB <<<"$OUT") MB on $DS: $FILE"
    break
  fi
done
[ -n "$FILE" ] || { echo "FCD $FCD not found on any NFS datastore"; exit 1; }
if [ -n "$NODE" ]; then
  VM=$("${VCURL[@]}" "${H[@]}" "https://$VC/api/vcenter/vm?names=$NODE" | jq -r '.[0].vm')
  if "${VCURL[@]}" "${H[@]}" "https://$VC/api/vcenter/vm/$VM" |
       jq -e --arg f "$FILE" '[.disks[].backing.vmdk_file] | index($f)' >/dev/null; then
    echo "MATCH: $FILE is attached to node VM $NODE ($VM)"
  else
    echo "MISMATCH: $FILE is not a disk of $NODE ($VM)"; exit 2
  fi
fi

# --- VMstore: find the vDisk by file name, print its latency split
JAR=$(mktemp); trap 'rm -f "$JAR"; "${VCURL[@]}" "${H[@]}" -X DELETE "https://$VC/api/session" >/dev/null || true' EXIT
TC=(curl -sS --fail-with-body --cacert "$TINTRI_CA_PEM" -b "$JAR" -c "$JAR" -H 'Accept: application/json')
jq -n --arg u "$TINTRI_USER" --arg p "$TINTRI_PASSWORD" --arg v "$TAPI" \
  '{typeId:"com.tintri.api.rest.vcommon.dto.rbac.RestApiCredentials", username:$u, password:$p, fullApiVersion:$v}' |
  "${TC[@]}" -H 'Content-Type: application/json' -X POST --data @- "https://$VMSTORE/api/v310/session/login" >/dev/null
BASE=$(basename "${FILE#*] }")
Q="vmName=${NODE}"; [ -n "$NODE" ] || Q="limit=500"
VD=$("${TC[@]}" "https://$VMSTORE/api/v310/virtualDisk?$Q" |
     jq -c --arg b "$BASE" '[.items[] | select((.path // "" | ascii_downcase) | endswith($b | ascii_downcase))][0]')
if [ "$VD" = null ]; then
  echo "VMstore: no vDisk path ends with $BASE (check the path format for your TxOS release)"
else
  echo "VMstore vDisk: $(jq -r '.name + "  path=" + .path + "  vm=" + (.vmName // "-")' <<<"$VD")"
  "${TC[@]}" "https://$VMSTORE/api/v310/virtualDisk/$(jq -r .vmUuid.uuid <<<"$VD")/$(jq -r .uuid.uuid <<<"$VD")/statsRealtime" |
    jq -r '(if type=="array" then . else .items end) as $p
           | (if ($p[0].sortedStats) then $p[0].sortedStats else $p end) | last
           | "latency ms total=\(.latencyTotalMs) host=\(.latencyHostMs) network=\(.latencyNetworkMs) storage=\(.latencyStorageMs) contention=\(.latencyContentionMs) throttle=\(.latencyThrottleMs)"'
fi
"${TC[@]}" -X POST "https://$VMSTORE/api/v310/session/logout" -o /dev/null || true
# Trace-PV.ps1: the same trace as trace-pv.sh in PowerShell 7. Read-only.
# Secrets from the environment: VC_USER, VC_PASSWORD, TINTRI_USER, TINTRI_PASSWORD. Needs kubectl on PATH.
param(
  [Parameter(Mandatory)][string]$Namespace,
  [Parameter(Mandatory)][string]$Pvc,
  [string]$VCenter   = 'vcenter01.lab.local',
  [string]$VMstore   = 'vmstore01.lab.local',
  [string]$ViRelease = '9.0.0.0',
  [string]$TintriApi = 'v310.207'
)
$ErrorActionPreference = 'Stop'
$pvName = kubectl -n $Namespace get pvc $Pvc -o jsonpath='{.spec.volumeName}'
if (-not $pvName) { throw "PVC $Namespace/$Pvc is not bound" }
$pv   = kubectl get pv $pvName -o json | ConvertFrom-Json
$fcd  = $pv.spec.csi.volumeHandle
$va   = (kubectl get volumeattachments -o json | ConvertFrom-Json).items |
          Where-Object { $_.spec.source.persistentVolumeName -eq $pvName -and $_.status.attached } | Select-Object -First 1
$node = $va.spec.nodeName
"PVC $Namespace/$Pvc -> PV $pvName -> FCD $fcd -> node $node"

# vCenter: one token for /api and /sdk/vim25
$pair  = [Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes("$($env:VC_USER):$($env:VC_PASSWORD)"))
$token = Invoke-RestMethod -Method Post -Uri "https://$VCenter/api/session" -Headers @{ Authorization = "Basic $pair" }
$vh    = @{ 'vmware-api-session-id' = $token }
try {
  $sc   = Invoke-RestMethod -Uri "https://$VCenter/sdk/vim25/$ViRelease/ServiceInstance/ServiceInstance/content" -Headers $vh
  $vsom = $sc.vStorageObjectManager
  $file = $null
  foreach ($ds in (Invoke-RestMethod -Uri "https://$VCenter/api/vcenter/datastore?types=NFS&types=NFS41" -Headers $vh)) {
    $body = @{ id = @{ _typeName = 'ID'; id = $fcd }
               datastore = @{ _typeName = 'ManagedObjectReference'; type = 'Datastore'; value = $ds.datastore } } | ConvertTo-Json
    try {
      $obj  = Invoke-RestMethod -Method Post -ContentType 'application/json' -Headers $vh -Body $body `
                -Uri "https://$VCenter/sdk/vim25/$ViRelease/$($vsom.type)/$($vsom.value)/RetrieveVStorageObject"
      $file = $obj.config.backing.filePath
      "FCD $($obj.config.name) $($obj.config.capacityInMB) MB on $($ds.name): $file"
      break
    } catch { continue }   # not on this datastore
  }
  if (-not $file) { throw "FCD $fcd not found on any NFS datastore" }
  $vm    = (Invoke-RestMethod -Uri "https://$VCenter/api/vcenter/vm?names=$node" -Headers $vh)[0].vm
  $disks = (Invoke-RestMethod -Uri "https://$VCenter/api/vcenter/vm/$vm" -Headers $vh).disks.PSObject.Properties.Value
  if ($disks.backing.vmdk_file -contains $file) { "MATCH: attached to $node ($vm)" } else { throw "MISMATCH: $file not on $node" }
}
finally { Invoke-RestMethod -Method Delete -Uri "https://$VCenter/api/session" -Headers $vh | Out-Null }

# VMstore: login, find the vDisk by file name, latest latency split, logout
$login = @{ typeId = 'com.tintri.api.rest.vcommon.dto.rbac.RestApiCredentials'; username = $env:TINTRI_USER
            password = $env:TINTRI_PASSWORD; fullApiVersion = $TintriApi } | ConvertTo-Json
Invoke-RestMethod -Method Post -Uri "https://$VMstore/api/v310/session/login" -ContentType 'application/json' `
  -Body $login -SessionVariable ts | Out-Null
try {
  $base  = Split-Path -Leaf ($file -replace '^\[[^\]]+\]\s*', '')
  $vd    = (Invoke-RestMethod -Uri "https://$VMstore/api/v310/virtualDisk?vmName=$node&limit=200" -WebSession $ts).items |
             Where-Object { "$($_.path)".ToLower().EndsWith($base.ToLower()) } | Select-Object -First 1
  if (-not $vd) { "VMstore: no vDisk path ends with $base (check the path format for your TxOS release)"; return }
  "VMstore vDisk $($vd.name) path=$($vd.path)"
  $page  = Invoke-RestMethod -Uri "https://$VMstore/api/v310/virtualDisk/$($vd.vmUuid.uuid)/$($vd.uuid.uuid)/statsRealtime" -WebSession $ts
  $s     = @($page.items[0].sortedStats)[-1]
  'latency ms total={0} host={1} network={2} storage={3} contention={4} throttle={5}' -f `
    $s.latencyTotalMs, $s.latencyHostMs, $s.latencyNetworkMs, $s.latencyStorageMs, $s.latencyContentionMs, $s.latencyThrottleMs
}
finally { Invoke-RestMethod -Method Post -Uri "https://$VMstore/api/v310/session/logout" -WebSession $ts | Out-Null }
$ ./trace-pv.sh demo data-pg-0
PVC demo/data-pg-0 -> PV pvc-7f3c2a10-1b2c-4d5e-8f90-a1b2c3d4e5f6 -> FCD <FCD_ID> -> node wk02
FCD pvc-7f3c2a10-1b2c-4d5e-8f90-a1b2c3d4e5f6 10240 MB on datastore-12: [ds-tintri-01] <folder>/<file>.vmdk
MATCH: [ds-tintri-01] <folder>/<file>.vmdk is attached to node VM wk02 (vm-2041)
VMstore vDisk: <file>.vmdk  path=<folder>/<file>.vmdk  vm=wk02
latency ms total=1.1 host=0.2 network=0.1 storage=0.8 contention=0 throttle=0

Read the last line the way the per-VM latency post explains. throttle above zero means a QoS ceiling is in effect. On Option A that ceiling is on the node VM, so it is shared by every PV on that node. {A(SITE + “auditing-tintri-per-vm-qos-finding-the-ceiling-nobody-removed/”, “The QoS audit”)} finds node VMs that inherited a ceiling from a template.

10. Lifecycle: expand, snapshot, restore, clone, delete

Figure 5 shows each lifecycle operation across the four layers, with the constraints that block it. The order of the subsections is also the safe order to run them in. Expand first, because the vSphere driver refuses to expand a volume that has snapshots.

Provision 1 Attach + mount 2 Expand 3 Snapshot 4 Restore / clone 5 Delete + reclaim 6 Kubernetes PVC Pending → Bound PV pvc-<uid> created volumeHandle = FCD ID VolumeAttachment attached = true pod Running PATCH PVC size allowVolumeExpansion FileSystemResize… VolumeSnapshot → SnapshotContent readyToUse = true new PVC with dataSource: VolumeSnapshot DELETE PVC → PV reclaimPolicy Delete or Retain CSI RPC CreateVolume provisioner sidecar policy + topology ControllerPublish NodeStage: mkfs, mount; NodePublish ControllerExpand + NodeExpand (online if in use) CreateSnapshot snapshotHandle = FCD ID + snap ID CreateVolume with snapshot source; no PVC→PVC clone DeleteSnapshot(s) then DeleteVolume PV finalizer clears vCenter CNS CNS creates FCD VMDK on ds-tintri-01 PVC/ns as metadata disk hot-added to node VM on PVSCSI (59 per node VM) CNS extends FCD refused while snapshots exist FCD snapshot default max 3 per volume (csi conf) new FCD from snap same datastore, same size CNS deletes FCD Retain: FCD stays (govc volume.rm) Tintri VMstore new VMDK file thin, on the export not attached yet I/O on that VMDK VM view: node VM (confirm per TxOS) VMDK file grows no data copy vSphere snapshot files on datastore offload: confirm new VMDK file copy may use VAAI clone offload VMDK removed VMstore snapshots may still hold space What blocks a step (vSphere CSI 3.8.x on vanilla Kubernetes) Expand (3): refused while the volume has snapshots, and while the node VM itself has a VM snapshot. Delete the snapshots first. Restore (5): the new PVC must land on the same datastore as the snapshot and request the same size, or provisioning fails. Clone (5): the driver does not advertise CLONE_VOLUME, so a PVC with a PVC dataSource is rejected. Use snapshot + restore. Delete (6): a volume that still has snapshots cannot be deleted; delete the VolumeSnapshots first. Retain leaves the FCD on ds-tintri-01 to clean up. Legend: lifecycle order what each layer does constraint / failure Option B (Tintri CSI, vmstore.csi.tintri.com): expand and VolumeSnapshot are supported by the driver; RWX variant (csi-driver-nfs): tar snapshots, no quota. Grey VMstore lines describe behaviour to confirm against your TxOS release.
Figure 5. The persistent volume lifecycle on Option A: what Kubernetes, the CSI RPCs, vCenter CNS and the VMstore each do, and what blocks each step.

Expand

Expansion needs allowVolumeExpansion: true on the class. The resizer calls ControllerExpandVolume and CNS extends the FCD. Then the kubelet calls NodeExpandVolume to grow the filesystem, online if the pod is running. CNS refuses to expand a volume that has CSI snapshots, and it also refuses while the node VM has a vSphere VM snapshot. A backup product that snapshots node VMs can block expansion without anyone noticing.

kubectl -n demo patch pvc data-pg-0 --type=merge -p '{"spec":{"resources":{"requests":{"storage":"20Gi"}}}}'
kubectl -n demo get pvc data-pg-0 -w      # CAPACITY goes 10Gi -> 20Gi
kubectl -n demo get events --field-selector involvedObject.name=data-pg-0 | grep -i resiz
# Resizing ... ExternalExpanding ... FileSystemResizeRequired ... FileSystemResizeSuccessful
kubectl -n demo exec pg-0 -- df -h /var/lib/postgresql/data
PATCH /api/v1/namespaces/demo/persistentvolumeclaims/data-pg-0 HTTP/1.1
Content-Type: application/merge-patch+json
Authorization: Bearer <SA_TOKEN>

{"spec":{"resources":{"requests":{"storage":"20Gi"}}}}
Invoke-RestMethod -Method Patch -Uri "$k/api/v1/namespaces/demo/persistentvolumeclaims/data-pg-0" -Headers $h `
  -ContentType 'application/merge-patch+json' -Body '{"spec":{"resources":{"requests":{"storage":"20Gi"}}}}'

On the VMstore the same vDisk now reports the larger size. No data is copied. If the PVC shows FileSystemResizePending, the pod was not running when the controller side finished, and the filesystem grows the next time the volume is mounted.

Snapshot

A VolumeSnapshot becomes a CNS snapshot of the FCD, and the snapshotHandle is the FCD ID and the snapshot ID joined by +. The snapshots are vSphere disk snapshots on the NFS datastore, which is why the default limit is 3 per volume. Keep them short-lived on NFS and use them as the source for a restore or a backup, not for retention. Snapshots need vSphere 7.0 U3 or later and work on block volumes only.

# lifecycle.yaml: snapshot the PostgreSQL volume, then restore it into a new PVC.
# Expand BEFORE you snapshot: the vSphere driver refuses to expand a volume that has snapshots.
apiVersion: snapshot.storage.k8s.io/v1
kind: VolumeSnapshot
metadata:
  name: data-pg-0-snap1
  namespace: demo
spec:
  volumeSnapshotClassName: tintri-snap
  source:
    persistentVolumeClaimName: data-pg-0
---
# Restore: same StorageClass (so the same datastore) and the same size as status.restoreSize of the snapshot.
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: data-pg-0-restore
  namespace: demo
spec:
  storageClassName: tintri-gold
  dataSource:
    name: data-pg-0-snap1
    kind: VolumeSnapshot
    apiGroup: snapshot.storage.k8s.io
  accessModes: ["ReadWriteOnce"]
  resources:
    requests:
      storage: 20Gi
$ kubectl -n demo get volumesnapshot data-pg-0-snap1
NAME              READYTOUSE   SOURCEPVC   RESTORESIZE   SNAPSHOTCLASS   SNAPSHOTCONTENT                                    AGE
data-pg-0-snap1   true         data-pg-0   20Gi          tintri-snap     snapcontent-0b6f...                                21s
$ kubectl get volumesnapshotcontent -o jsonpath='{.items[*].status.snapshotHandle}{"\n"}'
<FCD_ID>+<SNAPSHOT_ID>
$ govc disk.snapshot.ls -l <FCD_ID>

A CSI snapshot is crash-consistent, so quiesce the database first or use a backup tool that does. If you also take VMstore snapshots of the node VMs, remember they cover every PV attached to that node. That is useful for whole-node recovery, but it is not a per-application backup. The {A(SITE + “vmstore-snapshot-sprawl-an-audit-and-reclaim-report-in-powershell-and-python/”, “snapshot sprawl audit”)} shows what accumulates when nobody owns the cleanup.

Restore

Restore is a new PVC with a dataSource of kind VolumeSnapshot (the second document in the file above). CNS creates a new FCD from the snapshot. It must be on the same datastore and the same size as status.restoreSize, so use the same StorageClass and request exactly that size. Expand afterwards if you need more.

Clone

A PVC with a dataSource of kind PersistentVolumeClaim is a CSI clone. The vSphere driver on vanilla Kubernetes does not support it, and the request fails with an unsupported content-source error. The working pattern is snapshot, restore and then delete the snapshot. That takes three objects and a few seconds more. The RWX variant with csi-driver-nfs does support PVC-to-PVC clones, by copying the directory. For the Tintri driver, use snapshot and restore unless your release’s documentation lists cloning.

Delete and reclaim

Deleting a PVC with reclaim policy Delete makes the provisioner call DeleteVolume, and CNS deletes the FCD and its VMDK. Delete the VolumeSnapshots first: a volume with snapshots cannot be deleted, and the PV stays in Released with an error event. With Retain, the PV goes to Released and the FCD stays on ds-tintri-01. That is what you want for a database, but it is also where stale volumes come from.

# find CNS volumes whose PV no longer exists (read-only); compare with: kubectl get pv -o jsonpath='{..volumeHandle}'
govc volume.ls -l
# remove one CNS volume and its FCD after you have confirmed it is orphaned (destructive)
govc volume.rm <FCD_ID>
# or keep the disk and drop only the CNS record
govc volume.rm -keep <FCD_ID>

On the VMstore, freed space may not return at once if VMstore snapshots of the node VM still reference the blocks. Check the datastore statistics after the next snapshot expiry rather than right away.

11. Option B: the Tintri VMstore CSI driver

On Option B there is no CNS, no FCD and no vCenter in the data path. The driver mounts the VMstore folder over NFS from the node, and the published static-volume example shows a PV that is a volume file inside that folder (.../vmstorefs-mnt/persistent/volumefile-persistent.img). The CSIDriver has attachRequired: false, so there is no VolumeAttachment step: provisioning is followed directly by the node mount. Access modes are ReadWriteOnce, ReadOnlyMany and ReadWriteOncePod.

# tintri-csi-classes.yaml: StorageClass, VolumeSnapshotClass and a claim for the Tintri VMstore CSI driver (Option B).
# Access modes: ReadWriteOnce, ReadOnlyMany, ReadWriteOncePod. Not ReadWriteMany.
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: tintri-csi-gold
provisioner: vmstore.csi.tintri.com
allowVolumeExpansion: true
reclaimPolicy: Delete
volumeBindingMode: WaitForFirstConsumer
allowedTopologies:
  - matchLabelExpressions:
      - key: topology.vmstore.csi.tintri.com/zone
        values: ["zone-1"]
mountOptions:
  - vers=4.1          # check the NFS versions your TxOS release serves to Linux clients
---
apiVersion: snapshot.storage.k8s.io/v1
kind: VolumeSnapshotClass
metadata:
  name: tintri-csi-snap
driver: vmstore.csi.tintri.com
deletionPolicy: Delete
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: data-cache-0
  namespace: demo
spec:
  storageClassName: tintri-csi-gold
  accessModes: ["ReadWriteOncePod"]
  resources:
    requests:
      storage: 20Gi
  • Provision creates the volume on the VMstore through its API (the controller pod holds the VMstore credential). Volume names get the prefix pvc-vmstore. allowedTopologies with the topology.vmstore.csi.tintri.com/zone key picks the VMstore when you map more than one.
  • Expand is supported (allowVolumeExpansion: true in the shipped examples).
  • Snapshot and restore use a VolumeSnapshotClass with driver: vmstore.csi.tintri.com and the usual dataSource restore. The VMstore takes these, so the vSphere limit of 3 snapshots per volume does not apply. Check retention with your Tintri documentation.
  • Visibility: the VMstore API exposes CSI volume-file discovery (GET /v310/appliance/{uuid}/csiProperties, since v310.191) and a refresh of the CSI managed objects (POST /v310/datastore/{uuid}/hypervisorManagerConfig/csi/refresh). Together they let the VMstore present volume files as objects with their own statistics. Confirm the per-PV statistics and QoS behaviour on your release, because the public reference documents the calls but not the end-to-end result.
  • Security: the driver config secret holds a VMstore API credential, and the node pods are privileged. Keep the secret in a namespace only the platform team can read, and restrict the NFS export to node IPs.

The RWX variant: upstream csi-driver-nfs

If you need ReadWriteMany (shared content, build caches, datasets read by many pods), neither Option A on an NFS datastore nor the Tintri driver provides it. The upstream NFS driver can, by creating a subdirectory per PVC on an export. Whether Tintri supports generic Linux NFS clients writing into a VMstore export this way is not stated in public documentation, so confirm it before you rely on it.

# nfs-tintri.yaml: the RWX variant with the upstream NFS CSI driver (nfs.csi.k8s.io, v4.13.x).
# Confirm with your Tintri documentation that your TxOS release supports Linux NFS clients on this export,
# and which export path and NFS versions it offers. Values in <ANGLE_BRACKETS> are yours to fill in.
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: nfs-tintri
provisioner: nfs.csi.k8s.io
parameters:
  server: "<VMSTORE_GUEST_NFS_IP>"
  share: "<VMSTORE_EXPORT_PATH>"
  onDelete: "retain"          # delete | retain | archive; retain keeps the directory when the PVC goes
reclaimPolicy: Delete
volumeBindingMode: Immediate
allowVolumeExpansion: true   # size is recorded only; the driver sets no quota
mountOptions:
  - nfsvers=3
  - hard
---
apiVersion: snapshot.storage.k8s.io/v1
kind: VolumeSnapshotClass
metadata:
  name: nfs-tintri-snap
driver: nfs.csi.k8s.io
deletionPolicy: Delete
---
# RWX claim shared by several pods
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: shared-content
  namespace: demo
spec:
  storageClassName: nfs-tintri
  accessModes: ["ReadWriteMany"]
  resources:
    requests:
      storage: 50Gi
helm repo add csi-driver-nfs https://raw.githubusercontent.com/kubernetes-csi/csi-driver-nfs/master/charts
helm install csi-driver-nfs csi-driver-nfs/csi-driver-nfs --namespace kube-system --version 4.13.6 \
  --set externalSnapshotter.enabled=false   # the cluster already has a snapshot-controller
kubectl get csidriver nfs.csi.k8s.io

With this driver, expand only records the new size and sets no quota, so one PVC can fill the export. Snapshots are tar archives of the directory and clones are directory copies. Both take time in proportion to the data. onDelete decides whether a deleted PVC’s directory is removed, kept or renamed. Use namespace ResourceQuotas and VMstore capacity alerts to compensate.

12. API reference table

Checked against: Kubernetes 1.36 and 1.37 API reference (kubernetes.io), vSphere CSI 3.8.1 source, the vSphere Automation API reference 9.1.2 on developer.broadcom.com (all calls also present in 9.0), the vSphere Web Services API for the VI/JSON call, and the Tintri REST API v310.207 public reference. “Since” is the Kubernetes version where the API reached GA, the vSphere release where the call appeared on that path, or the Tintri API version. Kubernetes paths are relative to https://<api>:6443, vCenter to https://<vcenter> and VMstore to https://<vmstore>/api.

MethodPathPurposeKey fieldsSince
GET/versionServer versiongitVersion, minorKubernetes 1.0
POST / GET / PATCH / DELETE/api/v1/namespaces/{ns}/persistentvolumeclaims[/{name}]Create, read, expand, delete a claimspec.volumeName, status.phase, status.capacity, dataSourcev1 (expansion of CSI volumes GA 1.24)
GET/api/v1/persistentvolumes/{name}PV to FCDspec.csi.volumeHandle, persistentVolumeReclaimPolicy, finalizersv1 (CSI source GA 1.13)
GET/apis/storage.k8s.io/v1/volumeattachmentsWhich node a PV is attached tospec.nodeName, status.attached, attachError1.13
GET/apis/storage.k8s.io/v1/csidrivers/{name}Driver registrationattachRequired, fsGroupPolicy1.18
GET/apis/storage.k8s.io/v1/csinodesPer-node driver and volume limitdrivers[].nodeID, allocatable.count1.17
GET/apis/storage.k8s.io/v1/storageclasses/{name}Class parametersprovisioner, parameters, volumeBindingMode1.6
POST / GET / DELETE/apis/snapshot.storage.k8s.io/v1/namespaces/{ns}/volumesnapshots[/{name}]Snapshotsstatus.readyToUse, restoreSize, boundVolumeSnapshotContentNameCRD v1, GA in 1.20
GET/api/v1/namespaces/{ns}/events?fieldSelector=involvedObject.name={name}Why it is stuckreason, message, typev1
POST / DELETE/api/sessionvCenter tokenHTTP Basic in, token outvSphere 7.0 U2 (/api)
GET/api/vcenter/storage/policiesFind the policypolicy, namevSphere 7.0 U2 (/api)
GET/api/vcenter/datastore?names=Datastore MoRefdatastore, typevSphere 7.0 U2 (/api)
GET/api/vcenter/vm?names=, /api/vcenter/vm/{vm}Node VM and its disksdisks{}.backing.vmdk_filevSphere 7.0 U2 (/api)
GET/sdk/vim25/{release}/ServiceInstance/ServiceInstance/contentvStorageObjectManager MoRefvStorageObjectManagerVI/JSON vSphere 8.0 U1; /api token from 8.0 U3
POST/sdk/vim25/{release}/VcenterVStorageObjectManager/{moId}/RetrieveVStorageObjectFCD detailsconfig.name, capacityInMB, backing.filePathMethod vSphere 6.5; VI/JSON 8.0 U1
GET/infoAPI versionspreferredVersionv310 (pre-v310.101)
POST/v310/session/login, /v310/session/logoutVMstore sessionRestApiCredentials, fullApiVersion; JSESSIONIDv310 (pre-v310.101)
GET/v310/virtualDiskvDisks (VMstore only, paged)vmName, vmUuid, path filters; name, path, isSyntheticv310 (no since marker in the reference)
GET/v310/virtualDisk/{vmId}/{vdiskId}/statsRealtimePer-vDisk latency and IOPSlatency*Ms, operations*Iopsv310 (no since marker in the reference)
GET/v310/datastore/{uuid}/k8s/pv (also /pvc, /pod, /namespace, /deployment, /container)Kubernetes objects as the VMstore sees thempvName, pvcName, namespace, nodeName filters; vdUuid, vmTintriUuidv310.171
GET / POST/v310/datastore/{uuid}/hypervisorManagerConfigRegistrations, including type K8ShypervisorType, k8sConfig.apiEndpointUrl, clusterNamev310.21 (K8S type: confirm on your release)
GET/v310/appliance/{uuid}/csiPropertiesCSI volume-file discovery settingsisEnabled, directoryNames, fileExtensionsv310.191
POST/v310/datastore/{uuid}/hypervisorManagerConfig/csi/refreshRefresh CSI managed objects (asynchronous)none; returns at oncev310.191
GET/v310/vm?name=Node VM QoS and statsqosConfig, stat.sortedStatsv310 (pre-v310.101)
GET/v310/alertVMstore alertsstate, severityv310 (pre-v310.101)

The CSI RPCs in figure 2 (CreateVolume, ControllerPublishVolume, NodeStageVolume and the rest) are gRPC over a Unix socket inside the pods. They are not an API you call; you see them in the sidecar and driver logs.

13. Error shapes

The Kubernetes API returns a Status object on errors. The reason is more useful than the HTTP code:

HTTP/1.1 409 Conflict
{ "kind": "Status", "apiVersion": "v1", "status": "Failure",
  "message": "persistentvolumeclaims \"pv-trace-0\" already exists",
  "reason": "AlreadyExists", "details": { "name": "pv-trace-0", "kind": "persistentvolumeclaims" }, "code": 409 }

vCenter returns an error_type with a messages list on /api, and VI/JSON returns the fault as JSON with its _typeName (for example NotFound when the FCD is not on the datastore you asked). The VMstore returns a TintriError with a code such as ERR-API-8001. {L(“vmware-vsphere-tintri-vmstore-rest-api-guide”, “The VMstore REST API guide”)} has the full Tintri table.

HTTPKubernetes reasonvCenter / VMstoreTypical cause hereWhat to do
400BadRequestINVALID_ARGUMENT / TintriErrorMalformed JSON; wrong patch content type (use application/merge-patch+json); wrong typeId on the VMstore loginPrint the request body; compare with the examples
401UnauthorizedUNAUTHENTICATED / 401Expired ServiceAccount token, vCenter token or JSESSIONIDvCenter and VMstore: log in again once (the collection does this). Kubernetes: mint a new token
403ForbiddenUNAUTHORIZED / 403ServiceAccount lacks the verb (the message names it); vCenter account without CNS privileges; Read Only VMstore account doing a writekubectl auth can-i; the role list in section 04
404NotFoundNOT_FOUND / ERR-API-8001PV name empty because the PVC is not bound; snapshot CRDs not installed (404 on the whole snapshot.storage.k8s.io group); wrong VI/JSON release segmentCheck the earlier step; install the CRDs; set viRelease
409AlreadyExists / Conflictrare on these readsRe-running a create; an update against a stale resourceVersionGET and reuse; re-read before updating
422Invalidn/aShrinking a PVC; a field the API rejects (the message has the field path)Requests can only grow; fix the named field

The storage errors that matter most never come back as HTTP errors to you. A PVC create returns 201 and then sits in Pending. The failure is an event on the PVC, an attachError on the VolumeAttachment or a FailedMount event on the pod. The collection’s Troubleshoot folder reads all three.

14. The Postman collection and newman

The collection runs the whole post in order against three APIs. 01 Auth checks the Kubernetes token with /version and logs in to vCenter and the VMstore. 02 Discover checks the CSIDriver, CSINodes, the StorageClass, the snapshot classes, the storage policy and the datastore. 03 Deploy creates a PVC and a pause pod, then waits for Bound. 04 Verify is the trace in figure 4, plus the VMstore’s Kubernetes view when the cluster is registered. 05 Lifecycle expands, snapshots, waits and restores. 06 Troubleshoot reads events, attach errors, controller pods, node VM QoS and VMstore alerts. 07 Cleanup and logout deletes what 03 and 05 created and logs out of both sessions.

  • Safe by default. Requests named [WRITE] run only with allowWrites=true, and [DESTRUCTIVE] only with allowDestructive=true. The skip uses pm.execution.skipRequest(), so use newman 6.1.0 or later. With the shipped environment a run is read-only and works against an existing PVC: set pvcName to it.
  • Three kinds of session. Kubernetes uses a bearer token you supply in the secret variable k8sToken. The vCenter token is captured into vcSession and the VMstore JSESSIONID into tintriSession. A collection-level test logs in again once on a 401 from vCenter or the VMstore and retries the request.
  • Polling. “Wait for” requests re-run themselves with postman.setNextRequest() until the condition holds or pollMax tries pass. Use --delay-request to space the tries.
  • Idempotent creates. A 409 on a create counts as a pass, so a re-run after a failure continues instead of stopping.
  • Secrets. k8sToken, vcenterPassword and password are secret-type variables with empty values. Pass them at run time.

Save the following as 28-vmware-kubernetes-tintri-deploy-workflow-and-api.postman_collection.json and import it into Postman (Import, Files). The environment is the second block; save it as 28-vmware-kubernetes-tintri-deploy-workflow-and-api.postman_environment.json.

{
  "info": {
    "_postman_id": "a2e0bb5e-a2ef-567f-8050-0e56c9935891",
    "name": "VMware vSphere Kubernetes on Tintri: PV lifecycle and trace",
    "description": "Companion to 'VMware vSphere Kubernetes on Tintri: deploy workflow, persistent volume lifecycle and APIs end to end' on vmwareblogs.co.in. Run the folders in order. Requests named [WRITE] run only when allowWrites=true, [DESTRUCTIVE] only when allowDestructive=true (needs newman 6.1.0 or later for pm.execution.skipRequest). Checked against Kubernetes 1.36/1.37 APIs, vSphere CSI 3.8.1, vSphere Automation API 9.1.2 and Tintri REST API v310.207.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "noauth"
  },
  "event": [
    {
      "listen": "prerequest",
      "script": {
        "type": "text/javascript",
        "exec": [
          "// Guards: writes and deletes are opt-in.",
          "const name = pm.info.requestName || '';",
          "if (name.startsWith('[WRITE]') && pm.environment.get('allowWrites') !== 'true') {",
          "  console.log('SKIP ' + name + ' (set allowWrites=true)');",
          "  pm.execution.skipRequest();",
          "}",
          "if (name.startsWith('[DESTRUCTIVE]') && pm.environment.get('allowDestructive') !== 'true') {",
          "  console.log('SKIP ' + name + ' (set allowDestructive=true)');",
          "  pm.execution.skipRequest();",
          "}"
        ]
      }
    },
    {
      "listen": "test",
      "script": {
        "type": "text/javascript",
        "exec": [
          "// 401: log in again once (vCenter or VMstore) and retry this request. Kubernetes tokens cannot be renewed here.",
          "if (pm.response.code === 401 && !pm.environment.get('_retrying')) {",
          "  const url = pm.request.url.toString();",
          "  const vc = String(pm.environment.get('vcenterUrl') || '');",
          "  const ts = String(pm.environment.get('baseUrl') || '');",
          "  const login = vc && url.startsWith(vc) ? 'Login to vCenter' : (ts && url.startsWith(ts) ? 'Login to VMstore' : null);",
          "  if (login) { pm.environment.set('_retrying', pm.info.requestName); console.warn('401: ' + login + ', then retry'); postman.setNextRequest(login); }",
          "  else { console.error('401 from kube-apiserver: mint a new token with kubectl create token'); }",
          "}",
          "if (pm.response.code >= 400 && pm.response.code !== 401) {",
          "  console.warn(pm.info.requestName + ' -> HTTP ' + pm.response.code + ': ' + pm.response.text().slice(0, 600));",
          "}"
        ]
      }
    }
  ],
  "item": [
    {
      "name": "01 Auth",
      "item": [
        {
          "name": "K8s: API server version",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": "{{k8sApiUrl}}/version",
            "description": "Bearer token from a ServiceAccount (kubectl create token). 401 here means the token expired; mint a new one.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{k8sToken}}",
                  "type": "string"
                }
              ]
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!(pm.response.code === 401 && pm.environment.get('_retrying') === pm.info.requestName)) {",
                  "  pm.test('kube-apiserver answers 200', () => pm.response.to.have.status(200));",
                  "  const v = pm.response.json();",
                  "  console.log('Kubernetes ' + v.gitVersion);",
                  "  pm.test('server is 1.34 or newer', () => pm.expect(Number(v.minor.replace(/\\D/g, ''))).to.be.at.least(34));",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "Login to vCenter",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": "{{vcenterUrl}}/api/session",
            "description": "HTTP Basic in, token out. Send the token as vmware-api-session-id; it also works for /sdk/vim25 (VI/JSON) on 8.0 U3 and later.",
            "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('POST /api/session returns 200 or 201', () => pm.expect(pm.response.code).to.be.oneOf([200, 201]));",
                  "const token = pm.response.json();",
                  "pm.test('session token is a string', () => pm.expect(token).to.be.a('string').and.not.empty);",
                  "pm.environment.set('vcSession', token);",
                  "const back = pm.environment.get('_retrying');",
                  "if (back) { pm.environment.unset('_retrying'); postman.setNextRequest(back); }"
                ]
              }
            }
          ]
        },
        {
          "name": "VMstore API info",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": "{{baseUrl}}/api/info",
            "description": "Unauthenticated. Shows which API versions this VMstore serves."
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('GET /api/info returns 200', () => pm.response.to.have.status(200));",
                  "const i = pm.response.json();",
                  "console.log('VMstore ' + i.productName + ' preferred ' + i.preferredVersion);"
                ]
              }
            }
          ]
        },
        {
          "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": "Body is RestApiCredentials; the session is the JSESSIONID cookie. A Read Only account is enough for every non-write call here.",
            "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('VMstore login returns 200', () => pm.response.to.have.status(200));",
                  "const sid = pm.cookies.get('JSESSIONID');",
                  "pm.test('JSESSIONID captured', () => pm.expect(sid).to.be.a('string').and.not.empty);",
                  "pm.environment.set('tintriSession', sid);",
                  "const back = pm.environment.get('_retrying');",
                  "if (back) { pm.environment.unset('_retrying'); postman.setNextRequest(back); }"
                ]
              }
            }
          ]
        }
      ]
    },
    {
      "name": "02 Discover",
      "item": [
        {
          "name": "K8s: CSIDriver csi.vsphere.vmware.com",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": "{{k8sApiUrl}}/apis/storage.k8s.io/v1/csidrivers/csi.vsphere.vmware.com",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{k8sToken}}",
                  "type": "string"
                }
              ]
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!(pm.response.code === 401 && pm.environment.get('_retrying') === pm.info.requestName)) {",
                  "  pm.test('CSIDriver exists', () => pm.response.to.have.status(200));",
                  "  pm.test('attachRequired is true (block volumes attach through vCenter)', () => pm.expect(pm.response.json().spec.attachRequired).to.eql(true));",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "K8s: CSINodes",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": "{{k8sApiUrl}}/apis/storage.k8s.io/v1/csinodes",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{k8sToken}}",
                  "type": "string"
                }
              ]
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!(pm.response.code === 401 && pm.environment.get('_retrying') === pm.info.requestName)) {",
                  "  pm.test('200', () => pm.response.to.have.status(200));",
                  "  const nodes = pm.response.json().items;",
                  "  const reg = nodes.filter(n => (n.spec.drivers || []).some(d => d.name === 'csi.vsphere.vmware.com'));",
                  "  reg.forEach(n => { const d = n.spec.drivers.find(x => x.name === 'csi.vsphere.vmware.com');",
                  "    console.log(n.metadata.name + ' nodeID=' + d.nodeID + ' allocatable=' + JSON.stringify(d.allocatable || {})); });",
                  "  pm.test('vSphere CSI registered on at least one node', () => pm.expect(reg.length).to.be.above(0));",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "K8s: StorageClass",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": "{{k8sApiUrl}}/apis/storage.k8s.io/v1/storageclasses/{{storageClass}}",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{k8sToken}}",
                  "type": "string"
                }
              ]
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!(pm.response.code === 401 && pm.environment.get('_retrying') === pm.info.requestName)) {",
                  "  pm.test('StorageClass exists', () => pm.response.to.have.status(200));",
                  "  const sc = pm.response.json();",
                  "  pm.test('provisioner is a CSI driver we expect', () => pm.expect(sc.provisioner).to.be.oneOf(['csi.vsphere.vmware.com', 'nfs.csi.k8s.io']));",
                  "  pm.test('expansion allowed', () => pm.expect(sc.allowVolumeExpansion).to.eql(true));",
                  "  console.log('binding=' + sc.volumeBindingMode + ' params=' + JSON.stringify(sc.parameters || {}));",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "K8s: VolumeSnapshotClasses",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": "{{k8sApiUrl}}/apis/snapshot.storage.k8s.io/v1/volumesnapshotclasses",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{k8sToken}}",
                  "type": "string"
                }
              ]
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!(pm.response.code === 401 && pm.environment.get('_retrying') === pm.info.requestName)) {",
                  "  pm.test('snapshot CRDs installed (200, not 404)', () => pm.response.to.have.status(200));",
                  "  const c = pm.response.json().items.filter(i => i.driver === 'csi.vsphere.vmware.com');",
                  "  pm.test('a VolumeSnapshotClass for the vSphere driver exists', () => pm.expect(c.length).to.be.above(0));",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "vCenter: storage policies",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "vmware-api-session-id",
                "value": "{{vcSession}}"
              }
            ],
            "url": "{{vcenterUrl}}/api/vcenter/storage/policies"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!(pm.response.code === 401 && pm.environment.get('_retrying') === pm.info.requestName)) {",
                  "  pm.test('200', () => pm.response.to.have.status(200));",
                  "  const p = pm.response.json().find(x => x.name === pm.environment.get('storagePolicyName'));",
                  "  pm.test('policy named in the StorageClass exists', () => pm.expect(p).to.be.an('object'));",
                  "  if (p) { pm.environment.set('storagePolicyId', p.policy); }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "vCenter: datastore by name",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "vmware-api-session-id",
                "value": "{{vcSession}}"
              }
            ],
            "url": "{{vcenterUrl}}/api/vcenter/datastore?names={{datastoreName}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!(pm.response.code === 401 && pm.environment.get('_retrying') === pm.info.requestName)) {",
                  "  pm.test('200', () => pm.response.to.have.status(200));",
                  "  const d = pm.response.json()[0];",
                  "  pm.test('datastore found and NFS', () => { pm.expect(d).to.be.an('object'); pm.expect(d.type).to.match(/^NFS/); });",
                  "  if (d) { pm.environment.set('datastoreMoid', d.datastore); }",
                  "}"
                ]
              }
            }
          ]
        }
      ]
    },
    {
      "name": "03 Deploy (writes, opt-in)",
      "item": [
        {
          "name": "[WRITE] Create PVC",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": "{{k8sApiUrl}}/api/v1/namespaces/{{namespace}}/persistentvolumeclaims",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{k8sToken}}",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"apiVersion\": \"v1\",\n  \"kind\": \"PersistentVolumeClaim\",\n  \"metadata\": {\"name\": \"{{pvcName}}\", \"labels\": {\"app.kubernetes.io/part-of\": \"pv-trace\"}},\n  \"spec\": {\n    \"accessModes\": [\"ReadWriteOnce\"],\n    \"storageClassName\": \"{{storageClass}}\",\n    \"resources\": {\"requests\": {\"storage\": \"{{pvcSize}}\"}}\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!(pm.response.code === 401 && pm.environment.get('_retrying') === pm.info.requestName)) {",
                  "  pm.test('created (201) or already there (409)', () => pm.expect(pm.response.code).to.be.oneOf([201, 409]));",
                  "  if (pm.response.code === 409) { console.log('exists from an earlier run, continuing'); }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "[WRITE] Create probe pod (first consumer)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": "{{k8sApiUrl}}/api/v1/namespaces/{{namespace}}/pods",
            "description": "WaitForFirstConsumer classes provision only when a pod is scheduled. The pause image mounts the volume and does nothing else.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{k8sToken}}",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"apiVersion\": \"v1\",\n  \"kind\": \"Pod\",\n  \"metadata\": {\n    \"name\": \"pv-probe\",\n    \"labels\": {\n      \"app.kubernetes.io/part-of\": \"pv-trace\"\n    }\n  },\n  \"spec\": {\n    \"securityContext\": {\n      \"runAsNonRoot\": true,\n      \"runAsUser\": 65535,\n      \"fsGroup\": 65535,\n      \"seccompProfile\": {\n        \"type\": \"RuntimeDefault\"\n      }\n    },\n    \"containers\": [\n      {\n        \"name\": \"pause\",\n        \"image\": \"registry.k8s.io/pause:3.10\",\n        \"securityContext\": {\n          \"allowPrivilegeEscalation\": false,\n          \"capabilities\": {\n            \"drop\": [\n              \"ALL\"\n            ]\n          }\n        },\n        \"volumeMounts\": [\n          {\n            \"name\": \"data\",\n            \"mountPath\": \"/data\"\n          }\n        ]\n      }\n    ],\n    \"volumes\": [\n      {\n        \"name\": \"data\",\n        \"persistentVolumeClaim\": {\n          \"claimName\": \"{{pvcName}}\"\n        }\n      }\n    ]\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!(pm.response.code === 401 && pm.environment.get('_retrying') === pm.info.requestName)) {",
                  "  pm.test('created (201) or already there (409)', () => pm.expect(pm.response.code).to.be.oneOf([201, 409]));",
                  "  if (pm.response.code === 409) { console.log('exists from an earlier run, continuing'); }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "[WRITE] Wait for PVC Bound",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": "{{k8sApiUrl}}/api/v1/namespaces/{{namespace}}/persistentvolumeclaims/{{pvcName}}",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{k8sToken}}",
                  "type": "string"
                }
              ]
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!(pm.response.code === 401 && pm.environment.get('_retrying') === pm.info.requestName)) {",
                  "  const n = Number(pm.environment.get('pollCount') || 0);",
                  "  const max = Number(pm.environment.get('pollMax') || 60);",
                  "  const done = (() => { try { return pm.response.json().status.phase === 'Bound'; } catch (e) { return false; } })();",
                  "  if (!done && n < max) {",
                  "    pm.environment.set('pollCount', String(n + 1));",
                  "    console.log('waiting for PVC Bound, try ' + (n + 1) + '/' + max);",
                  "    setTimeout(() => {}, 5000);",
                  "    postman.setNextRequest(pm.info.requestName);",
                  "  } else {",
                  "    pm.environment.set('pollCount', '0');",
                  "    pm.test('PVC Bound within ' + max + ' tries', () => pm.expect(done).to.be.true);",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        }
      ]
    },
    {
      "name": "04 Verify (trace PV to VMstore vDisk)",
      "item": [
        {
          "name": "K8s: PVC",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": "{{k8sApiUrl}}/api/v1/namespaces/{{namespace}}/persistentvolumeclaims/{{pvcName}}",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{k8sToken}}",
                  "type": "string"
                }
              ]
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!(pm.response.code === 401 && pm.environment.get('_retrying') === pm.info.requestName)) {",
                  "  pm.test('PVC exists', () => pm.response.to.have.status(200));",
                  "  const c = pm.response.json();",
                  "  pm.test('PVC is Bound', () => pm.expect(c.status.phase).to.eql('Bound'));",
                  "  pm.environment.set('pvName', c.spec.volumeName || '');",
                  "  console.log('PV ' + c.spec.volumeName + ' capacity ' + JSON.stringify(c.status.capacity || {}));",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "K8s: PV",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": "{{k8sApiUrl}}/api/v1/persistentvolumes/{{pvName}}",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{k8sToken}}",
                  "type": "string"
                }
              ]
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!(pm.response.code === 401 && pm.environment.get('_retrying') === pm.info.requestName)) {",
                  "  pm.test('PV exists (404 means the PVC is not bound yet)', () => pm.response.to.have.status(200));",
                  "  const pv = pm.response.json();",
                  "  pm.test('vSphere CSI volume', () => pm.expect(pv.spec.csi.driver).to.eql('csi.vsphere.vmware.com'));",
                  "  pm.environment.set('fcdId', pv.spec.csi.volumeHandle);",
                  "  console.log('FCD (CNS volume) ID ' + pv.spec.csi.volumeHandle + ' reclaim ' + pv.spec.persistentVolumeReclaimPolicy);",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "K8s: VolumeAttachments",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": "{{k8sApiUrl}}/apis/storage.k8s.io/v1/volumeattachments",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{k8sToken}}",
                  "type": "string"
                }
              ]
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!(pm.response.code === 401 && pm.environment.get('_retrying') === pm.info.requestName)) {",
                  "  pm.test('200', () => pm.response.to.have.status(200));",
                  "  const va = pm.response.json().items.find(v => v.spec.source.persistentVolumeName === pm.environment.get('pvName'));",
                  "  pm.test('volume is attached to a node', () => { pm.expect(va).to.be.an('object'); pm.expect(va.status.attached).to.eql(true); });",
                  "  if (va) { pm.environment.set('nodeName', va.spec.nodeName); console.log('attached to ' + va.spec.nodeName + ' via ' + va.metadata.name); }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "vCenter: node VM by name",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "vmware-api-session-id",
                "value": "{{vcSession}}"
              }
            ],
            "url": "{{vcenterUrl}}/api/vcenter/vm?names={{nodeName}}",
            "description": "Assumes the node VM name equals the Kubernetes node name. If yours differ, match on the BIOS UUID in node.spec.providerID instead."
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!(pm.response.code === 401 && pm.environment.get('_retrying') === pm.info.requestName)) {",
                  "  pm.test('200', () => pm.response.to.have.status(200));",
                  "  const v = pm.response.json();",
                  "  pm.test('exactly one VM has the node name', () => pm.expect(v.length).to.eql(1));",
                  "  if (v.length === 1) pm.environment.set('nodeVmId', v[0].vm);",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "vCenter: node VM disks",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "vmware-api-session-id",
                "value": "{{vcSession}}"
              }
            ],
            "url": "{{vcenterUrl}}/api/vcenter/vm/{{nodeVmId}}"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!(pm.response.code === 401 && pm.environment.get('_retrying') === pm.info.requestName)) {",
                  "  pm.test('200', () => pm.response.to.have.status(200));",
                  "  const disks = Object.values(pm.response.json().disks || {});",
                  "  const files = disks.filter(d => d.backing && d.backing.vmdk_file).map(d => d.backing.vmdk_file);",
                  "  console.log('node VM disks: ' + files.join(' | '));",
                  "  pm.environment.set('nodeVmdkFiles', JSON.stringify(files));",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "VI/JSON: service content",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "vmware-api-session-id",
                "value": "{{vcSession}}"
              }
            ],
            "url": "{{vcenterUrl}}/sdk/vim25/{{viRelease}}/ServiceInstance/ServiceInstance/content",
            "description": "Reads the managed object reference of the FCD manager instead of hard-coding it."
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!(pm.response.code === 401 && pm.environment.get('_retrying') === pm.info.requestName)) {",
                  "  pm.test('200', () => pm.response.to.have.status(200));",
                  "  const m = pm.response.json().vStorageObjectManager;",
                  "  pm.test('vStorageObjectManager present', () => pm.expect(m).to.be.an('object'));",
                  "  if (m) { pm.environment.set('vsomType', m.type); pm.environment.set('vsomId', m.value); }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "VI/JSON: RetrieveVStorageObject (FCD)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "vmware-api-session-id",
                "value": "{{vcSession}}"
              }
            ],
            "url": "{{vcenterUrl}}/sdk/vim25/{{viRelease}}/{{vsomType}}/{{vsomId}}/RetrieveVStorageObject",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"id\": { \"_typeName\": \"ID\", \"id\": \"{{fcdId}}\" },\n  \"datastore\": { \"_typeName\": \"ManagedObjectReference\", \"type\": \"Datastore\", \"value\": \"{{datastoreMoid}}\" }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!(pm.response.code === 401 && pm.environment.get('_retrying') === pm.info.requestName)) {",
                  "  pm.test('200', () => pm.response.to.have.status(200));",
                  "  const o = pm.response.json();",
                  "  const fp = o.config && o.config.backing && o.config.backing.filePath;",
                  "  pm.test('FCD has a VMDK file path', () => pm.expect(fp).to.be.a('string'));",
                  "  pm.environment.set('fcdFilePath', fp || '');",
                  "  console.log('FCD ' + o.config.name + ' ' + o.config.capacityInMB + ' MB at ' + fp);",
                  "  const files = JSON.parse(pm.environment.get('nodeVmdkFiles') || '[]');",
                  "  pm.test('that VMDK is attached to the node VM', () => pm.expect(files).to.include(fp));",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "VMstore: vDisks of the node VM",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Cookie",
                "value": "JSESSIONID={{tintriSession}}"
              }
            ],
            "url": "{{baseUrl}}/api/v310/virtualDisk?vmName={{nodeName}}&limit=200",
            "description": "VMstoreOnly call. Matches on the VMDK file name; check the path format against your TxOS build (see the post)."
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!(pm.response.code === 401 && pm.environment.get('_retrying') === pm.info.requestName)) {",
                  "  pm.test('200', () => pm.response.to.have.status(200));",
                  "  const fp = (pm.environment.get('fcdFilePath') || '').replace(/^\\[[^\\]]+\\]\\s*/, '');",
                  "  const base = fp.split('/').pop().toLowerCase();",
                  "  const items = pm.response.json().items || [];",
                  "  items.forEach(d => console.log('vDisk ' + d.name + ' path=' + d.path));",
                  "  const hit = items.find(d => String(d.path || '').toLowerCase().endsWith(base));",
                  "  pm.test('VMstore reports a vDisk for the FCD file', () => pm.expect(hit).to.be.an('object'));",
                  "  if (hit) { pm.environment.set('vdiskUuid', hit.uuid.uuid); pm.environment.set('vmstoreVmUuid', hit.vmUuid.uuid); }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "VMstore: Kubernetes PV view (v310.171+)",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Cookie",
                "value": "JSESSIONID={{tintriSession}}"
              }
            ],
            "url": "{{baseUrl}}/api/v310/datastore/default/k8s/pv?pvName={{pvName}}&limit=10",
            "description": "Only populated when the Kubernetes cluster is registered on the VMstore (hypervisorManagerConfig of type K8S). Maps a PV straight to vdUuid and the node VM."
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!(pm.response.code === 401 && pm.environment.get('_retrying') === pm.info.requestName)) {",
                  "  pm.test('200, or 4xx when the VMstore has no Kubernetes registration / older API', () => pm.expect(pm.response.code).to.be.oneOf([200, 400, 404]));",
                  "  if (pm.response.code === 200) {",
                  "    const pv = (pm.response.json().items || [])[0];",
                  "    if (pv) {",
                  "      console.log('VMstore k8s view: ' + pv.name + ' pvc ' + pv.pvcNamespace + '/' + pv.pvcName + ' node ' + pv.nodeName + ' vm ' + pv.vmName + ' vdUuid ' + pv.vdUuid);",
                  "      if (pv.vdUuid && !pm.environment.get('vdiskUuid')) { pm.environment.set('vdiskUuid', pv.vdUuid); pm.environment.set('vmstoreVmUuid', pv.vmTintriUuid); }",
                  "    } else { console.log('VMstore k8s view has no PV named ' + pm.environment.get('pvName') + ' (cluster not registered on this VMstore?)'); }",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "VMstore: vDisk realtime stats",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Cookie",
                "value": "JSESSIONID={{tintriSession}}"
              }
            ],
            "url": "{{baseUrl}}/api/v310/virtualDisk/{{vmstoreVmUuid}}/{{vdiskUuid}}/statsRealtime"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!(pm.response.code === 401 && pm.environment.get('_retrying') === pm.info.requestName)) {",
                  "  pm.test('200', () => pm.response.to.have.status(200));",
                  "  const b = pm.response.json();",
                  "  const page = Array.isArray(b) ? b : (b.items || []);",
                  "  const stats = page.length && page[0].sortedStats ? page[0].sortedStats : page;",
                  "  const s = stats[stats.length - 1] || {};",
                  "  console.log('latency total ' + s.latencyTotalMs + ' ms (host ' + s.latencyHostMs + ', network ' + s.latencyNetworkMs +",
                  "    ', storage ' + s.latencyStorageMs + ', contention ' + s.latencyContentionMs + ', throttle ' + s.latencyThrottleMs + ')');",
                  "}"
                ]
              }
            }
          ]
        }
      ]
    },
    {
      "name": "05 Lifecycle (writes, opt-in)",
      "item": [
        {
          "name": "[WRITE] Expand PVC",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/merge-patch+json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": "{{k8sApiUrl}}/api/v1/namespaces/{{namespace}}/persistentvolumeclaims/{{pvcName}}",
            "description": "Runs before the snapshot on purpose: the vSphere driver refuses to expand a volume that has snapshots.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{k8sToken}}",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\"spec\": {\"resources\": {\"requests\": {\"storage\": \"{{expandTo}}\"}}}}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!(pm.response.code === 401 && pm.environment.get('_retrying') === pm.info.requestName)) {",
                  "  pm.test('PATCH accepted (200)', () => pm.response.to.have.status(200));",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "[WRITE] Wait for expansion",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": "{{k8sApiUrl}}/api/v1/namespaces/{{namespace}}/persistentvolumeclaims/{{pvcName}}",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{k8sToken}}",
                  "type": "string"
                }
              ]
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!(pm.response.code === 401 && pm.environment.get('_retrying') === pm.info.requestName)) {",
                  "  const n = Number(pm.environment.get('pollCount') || 0);",
                  "  const max = Number(pm.environment.get('pollMax') || 60);",
                  "  const done = (() => { try { return pm.response.json().status.capacity.storage === pm.environment.get('expandTo'); } catch (e) { return false; } })();",
                  "  if (!done && n < max) {",
                  "    pm.environment.set('pollCount', String(n + 1));",
                  "    console.log('waiting for PVC capacity = expandTo, try ' + (n + 1) + '/' + max);",
                  "    setTimeout(() => {}, 5000);",
                  "    postman.setNextRequest(pm.info.requestName);",
                  "  } else {",
                  "    pm.environment.set('pollCount', '0');",
                  "    pm.test('PVC capacity = expandTo within ' + max + ' tries', () => pm.expect(done).to.be.true);",
                  "  }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "[WRITE] Create VolumeSnapshot",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": "{{k8sApiUrl}}/apis/snapshot.storage.k8s.io/v1/namespaces/{{namespace}}/volumesnapshots",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{k8sToken}}",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"apiVersion\": \"snapshot.storage.k8s.io/v1\",\n  \"kind\": \"VolumeSnapshot\",\n  \"metadata\": {\"name\": \"{{pvcName}}-snap\", \"labels\": {\"app.kubernetes.io/part-of\": \"pv-trace\"}},\n  \"spec\": {\n    \"volumeSnapshotClassName\": \"{{snapshotClass}}\",\n    \"source\": {\"persistentVolumeClaimName\": \"{{pvcName}}\"}\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!(pm.response.code === 401 && pm.environment.get('_retrying') === pm.info.requestName)) {",
                  "  pm.test('created (201) or already there (409)', () => pm.expect(pm.response.code).to.be.oneOf([201, 409]));",
                  "  if (pm.response.code === 409) { console.log('exists from an earlier run, continuing'); }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "[WRITE] Wait for snapshot readyToUse",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": "{{k8sApiUrl}}/apis/snapshot.storage.k8s.io/v1/namespaces/{{namespace}}/volumesnapshots/{{pvcName}}-snap",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{k8sToken}}",
                  "type": "string"
                }
              ]
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!(pm.response.code === 401 && pm.environment.get('_retrying') === pm.info.requestName)) {",
                  "  const n = Number(pm.environment.get('pollCount') || 0);",
                  "  const max = Number(pm.environment.get('pollMax') || 60);",
                  "  const done = (() => { try { return pm.response.json().status.readyToUse === true; } catch (e) { return false; } })();",
                  "  if (!done && n < max) {",
                  "    pm.environment.set('pollCount', String(n + 1));",
                  "    console.log('waiting for snapshot readyToUse, try ' + (n + 1) + '/' + max);",
                  "    setTimeout(() => {}, 5000);",
                  "    postman.setNextRequest(pm.info.requestName);",
                  "  } else {",
                  "    pm.environment.set('pollCount', '0');",
                  "    pm.test('snapshot readyToUse within ' + max + ' tries', () => pm.expect(done).to.be.true);",
                  "  }",
                  "  const st = pm.response.json().status || {};",
                  "  console.log('snapshotContent ' + st.boundVolumeSnapshotContentName + ' restoreSize ' + st.restoreSize);",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "[WRITE] Restore PVC from snapshot",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": "{{k8sApiUrl}}/api/v1/namespaces/{{namespace}}/persistentvolumeclaims",
            "description": "Same StorageClass (so the same datastore) and the same size as the snapshot restoreSize, or CNS refuses it.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{k8sToken}}",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"apiVersion\": \"v1\",\n  \"kind\": \"PersistentVolumeClaim\",\n  \"metadata\": {\"name\": \"{{pvcName}}-restore\", \"labels\": {\"app.kubernetes.io/part-of\": \"pv-trace\"}},\n  \"spec\": {\n    \"accessModes\": [\"ReadWriteOnce\"],\n    \"storageClassName\": \"{{storageClass}}\",\n    \"dataSource\": {\"name\": \"{{pvcName}}-snap\", \"kind\": \"VolumeSnapshot\", \"apiGroup\": \"snapshot.storage.k8s.io\"},\n    \"resources\": {\"requests\": {\"storage\": \"{{expandTo}}\"}}\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!(pm.response.code === 401 && pm.environment.get('_retrying') === pm.info.requestName)) {",
                  "  pm.test('created (201) or already there (409)', () => pm.expect(pm.response.code).to.be.oneOf([201, 409]));",
                  "  if (pm.response.code === 409) { console.log('exists from an earlier run, continuing'); }",
                  "}"
                ]
              }
            }
          ]
        }
      ]
    },
    {
      "name": "06 Troubleshoot",
      "item": [
        {
          "name": "K8s: events for the PVC",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": "{{k8sApiUrl}}/api/v1/namespaces/{{namespace}}/events?fieldSelector=involvedObject.name%3D{{pvcName}}",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{k8sToken}}",
                  "type": "string"
                }
              ]
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!(pm.response.code === 401 && pm.environment.get('_retrying') === pm.info.requestName)) {",
                  "  pm.test('200', () => pm.response.to.have.status(200));",
                  "  pm.response.json().items.forEach(e => console.log(e.lastTimestamp + ' ' + e.type + ' ' + e.reason + ': ' + e.message));",
                  "  const bad = pm.response.json().items.filter(e => e.type === 'Warning');",
                  "  pm.test('no Warning events on the PVC', () => pm.expect(bad.length).to.eql(0));",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "K8s: VolumeAttachment errors",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": "{{k8sApiUrl}}/apis/storage.k8s.io/v1/volumeattachments",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{k8sToken}}",
                  "type": "string"
                }
              ]
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!(pm.response.code === 401 && pm.environment.get('_retrying') === pm.info.requestName)) {",
                  "  pm.test('200', () => pm.response.to.have.status(200));",
                  "  const err = pm.response.json().items.filter(v => v.status && (v.status.attachError || v.status.detachError));",
                  "  err.forEach(v => console.warn(v.spec.source.persistentVolumeName + ' on ' + v.spec.nodeName + ': ' +",
                  "    JSON.stringify(v.status.attachError || v.status.detachError)));",
                  "  pm.test('no attach or detach errors', () => pm.expect(err.length).to.eql(0));",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "K8s: vSphere CSI controller pods",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": "{{k8sApiUrl}}/api/v1/namespaces/{{csiNamespace}}/pods?labelSelector=app%3Dvsphere-csi-controller",
            "description": "csiNamespace is vmware-system-csi on vanilla Kubernetes and openshift-cluster-csi-drivers on OpenShift (where the label differs; adjust the selector).",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{k8sToken}}",
                  "type": "string"
                }
              ]
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!(pm.response.code === 401 && pm.environment.get('_retrying') === pm.info.requestName)) {",
                  "  pm.test('200', () => pm.response.to.have.status(200));",
                  "  const pods = pm.response.json().items;",
                  "  pods.forEach(p => console.log(p.metadata.name + ' ' + p.status.phase + ' on ' + p.spec.nodeName));",
                  "  pm.test('every controller pod is Running', () => pm.expect(pods.every(p => p.status.phase === 'Running')).to.be.true);",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "VMstore: node VM QoS and latency",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Cookie",
                "value": "JSESSIONID={{tintriSession}}"
              }
            ],
            "url": "{{baseUrl}}/api/v310/vm?name={{nodeName}}&live=TRUE&limit=10",
            "description": "A per-VM QoS ceiling on a node VM caps every PV attached to it."
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!(pm.response.code === 401 && pm.environment.get('_retrying') === pm.info.requestName)) {",
                  "  pm.test('200', () => pm.response.to.have.status(200));",
                  "  const vm = (pm.response.json().items || [])[0];",
                  "  pm.test('node VM known to the VMstore', () => pm.expect(vm).to.be.an('object'));",
                  "  if (vm) { const s = ((vm.stat || {}).sortedStats || []).slice(-1)[0] || {};",
                  "    console.log('QoS ' + JSON.stringify(vm.qosConfig) + ' throttle ' + s.latencyThrottleMs + ' ms, total ' + s.latencyTotalMs + ' ms'); }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "VMstore: new alerts",
          "request": {
            "method": "GET",
            "header": [
              {
                "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": [
                  "if (!(pm.response.code === 401 && pm.environment.get('_retrying') === pm.info.requestName)) {",
                  "  pm.test('200', () => pm.response.to.have.status(200));",
                  "  const a = pm.response.json().items || [];",
                  "  a.forEach(x => console.log(x.severity + ' ' + x.message));",
                  "}"
                ]
              }
            }
          ]
        }
      ]
    },
    {
      "name": "07 Cleanup and logout",
      "item": [
        {
          "name": "[DESTRUCTIVE] Delete restored PVC",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": "{{k8sApiUrl}}/api/v1/namespaces/{{namespace}}/persistentvolumeclaims/{{pvcName}}-restore",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{k8sToken}}",
                  "type": "string"
                }
              ]
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!(pm.response.code === 401 && pm.environment.get('_retrying') === pm.info.requestName)) {",
                  "  pm.test('deleted (200/202) or already gone (404)', () => pm.expect(pm.response.code).to.be.oneOf([200, 202, 404]));",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "[DESTRUCTIVE] Delete VolumeSnapshot",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": "{{k8sApiUrl}}/apis/snapshot.storage.k8s.io/v1/namespaces/{{namespace}}/volumesnapshots/{{pvcName}}-snap",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{k8sToken}}",
                  "type": "string"
                }
              ]
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!(pm.response.code === 401 && pm.environment.get('_retrying') === pm.info.requestName)) {",
                  "  pm.test('deleted (200/202) or already gone (404)', () => pm.expect(pm.response.code).to.be.oneOf([200, 202, 404]));",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "[DESTRUCTIVE] Delete probe pod",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": "{{k8sApiUrl}}/api/v1/namespaces/{{namespace}}/pods/pv-probe",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{k8sToken}}",
                  "type": "string"
                }
              ]
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!(pm.response.code === 401 && pm.environment.get('_retrying') === pm.info.requestName)) {",
                  "  pm.test('deleted (200/202) or already gone (404)', () => pm.expect(pm.response.code).to.be.oneOf([200, 202, 404]));",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "[DESTRUCTIVE] Delete PVC",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": "{{k8sApiUrl}}/api/v1/namespaces/{{namespace}}/persistentvolumeclaims/{{pvcName}}",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{k8sToken}}",
                  "type": "string"
                }
              ]
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!(pm.response.code === 401 && pm.environment.get('_retrying') === pm.info.requestName)) {",
                  "  pm.test('deleted (200/202) or already gone (404)', () => pm.expect(pm.response.code).to.be.oneOf([200, 202, 404]));",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "Logout from VMstore",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Cookie",
                "value": "JSESSIONID={{tintriSession}}"
              }
            ],
            "url": "{{baseUrl}}/api/v310/session/logout"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('logout 204 (or 200)', () => pm.expect(pm.response.code).to.be.oneOf([200, 204]));",
                  "pm.environment.unset('tintriSession');"
                ]
              }
            }
          ]
        },
        {
          "name": "Logout from vCenter",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "vmware-api-session-id",
                "value": "{{vcSession}}"
              }
            ],
            "url": "{{vcenterUrl}}/api/session"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('logout 204', () => pm.response.to.have.status(204));",
                  "pm.environment.unset('vcSession');"
                ]
              }
            }
          ]
        }
      ]
    }
  ]
}
{
  "id": "098ba98f-cda7-5696-ad49-c24972b95094",
  "name": "k8s-api.lab.local + vcenter01.lab.local + vmstore01.lab.local",
  "values": [
    {
      "key": "k8sApiUrl",
      "value": "https://k8s-api.lab.local:6443",
      "type": "default",
      "enabled": true
    },
    {
      "key": "k8sToken",
      "value": "",
      "type": "secret",
      "enabled": true
    },
    {
      "key": "namespace",
      "value": "demo",
      "type": "default",
      "enabled": true
    },
    {
      "key": "csiNamespace",
      "value": "vmware-system-csi",
      "type": "default",
      "enabled": true
    },
    {
      "key": "pvcName",
      "value": "pv-trace-0",
      "type": "default",
      "enabled": true
    },
    {
      "key": "pvcSize",
      "value": "10Gi",
      "type": "default",
      "enabled": true
    },
    {
      "key": "expandTo",
      "value": "20Gi",
      "type": "default",
      "enabled": true
    },
    {
      "key": "storageClass",
      "value": "tintri-gold",
      "type": "default",
      "enabled": true
    },
    {
      "key": "snapshotClass",
      "value": "tintri-snap",
      "type": "default",
      "enabled": true
    },
    {
      "key": "storagePolicyName",
      "value": "tintri-gold",
      "type": "default",
      "enabled": true
    },
    {
      "key": "datastoreName",
      "value": "ds-tintri-01",
      "type": "default",
      "enabled": true
    },
    {
      "key": "vcenterUrl",
      "value": "https://vcenter01.lab.local",
      "type": "default",
      "enabled": true
    },
    {
      "key": "vcenterUsername",
      "value": "svc-k8s-trace@vsphere.local",
      "type": "default",
      "enabled": true
    },
    {
      "key": "vcenterPassword",
      "value": "",
      "type": "secret",
      "enabled": true
    },
    {
      "key": "viRelease",
      "value": "9.0.0.0",
      "type": "default",
      "enabled": true
    },
    {
      "key": "baseUrl",
      "value": "https://vmstore01.lab.local",
      "type": "default",
      "enabled": true
    },
    {
      "key": "username",
      "value": "svc-vmstore-ro",
      "type": "default",
      "enabled": true
    },
    {
      "key": "password",
      "value": "",
      "type": "secret",
      "enabled": true
    },
    {
      "key": "fullApiVersion",
      "value": "v310.207",
      "type": "default",
      "enabled": true
    },
    {
      "key": "allowWrites",
      "value": "false",
      "type": "default",
      "enabled": true
    },
    {
      "key": "allowDestructive",
      "value": "false",
      "type": "default",
      "enabled": true
    },
    {
      "key": "pollMax",
      "value": "60",
      "type": "default",
      "enabled": true
    },
    {
      "key": "pollCount",
      "value": "0",
      "type": "default",
      "enabled": true
    },
    {
      "key": "nodeName",
      "value": "",
      "type": "default",
      "enabled": true
    }
  ],
  "_postman_variable_scope": "environment"
}

Run it with newman. Secrets come from the shell environment, never from the file:

npm install -g newman@6.2.3
newman run 28-vmware-kubernetes-tintri-deploy-workflow-and-api.postman_collection.json \
  -e 28-vmware-kubernetes-tintri-deploy-workflow-and-api.postman_environment.json \
  --env-var "k8sToken=$(kubectl -n demo create token pv-trace --duration=1h)" \
  --env-var "vcenterPassword=$VC_PASSWORD" --env-var "password=$TINTRI_PASSWORD" \
  --env-var pvcName=data-pg-0 \
  --ssl-extra-ca-certs ./lab-ca-bundle.pem \
  --delay-request 200 --timeout-request 30000 \
  --reporters cli,junit --reporter-junit-export newman-pv-trace.xml

# full lifecycle on a scratch PVC (creates, expands, snapshots, restores, then deletes)
newman run ... --env-var pvcName=pv-trace-0 --env-var allowWrites=true --env-var allowDestructive=true

Use --ssl-extra-ca-certs with the CA that signed the three endpoints. --insecure turns off certificate checks for everything in the run. It is acceptable in a throwaway lab, but never in CI against production. The read-only run makes a good nightly smoke test. It fails on a missing driver registration, a policy with no datastore, attach errors, Warning events on the PVC or a VMstore alert, and the JUnit file plugs into any CI system.

15. End-to-end workflow with verification

From empty node VMs to a traced stateful app, on vanilla Kubernetes. Each step has a check and its expected result. Stop at the first check that fails and use section 16.

#DoVerifyExpected
1Jumbo frames on VLAN 30vmkping -I vmk2 -d -s 8972 10.0.30.40 on every host0% packet loss
2Prepare-K8sOnTintri.ps1, then -ConfigureNodes and power-cycle the nodesGet-SpbmCompatibleStorage; govc vm.info -e wk02Only ds-tintri-01; disk.enableUUID TRUE
3Build the cluster with the external cloud providerkubectl get nodesAll nodes listed (NotReady until a CNI is installed)
4CPI (part 1 of install-vsphere-csi.sh)kubectl get nodes -o jsonpath='{..providerID}'vsphere://4203... on every node; uninitialized taint gone
5Secret, driver, snapshot componentskubectl get csinodes -o wideEvery node lists csi.vsphere.vmware.com
6kubectl apply -f tintri-classes.yamlkubectl get sc,volumesnapshotclasstintri-gold (default), tintri-snap
7kubectl apply -f demo-pg.yamlkubectl -n demo get pvc,poddata-pg-0 Bound 10Gi; pg-0 1/1 Running
8./trace-pv.sh demo data-pg-0Script outputMATCH and a latency line
9Expand to 20Gikubectl -n demo exec pg-0 -- df -h /var/lib/postgresql/dataAbout 20G
10Snapshot, then restore (lifecycle.yaml)kubectl -n demo get volumesnapshot,pvcREADYTOUSE true; data-pg-0-restore Bound
11Delete the snapshot and the restored PVCgovc volume.ls | grep -c data-pg-0One CNS volume for data-pg-0 (the original)
12Add the read-only newman run to CIPipeline resultAll assertions pass

16. Troubleshooting

Start from the Kubernetes event. It tells you which phase in figure 2 stopped, and then the table tells you which layer to check. For the layers under the hypervisor (fabric, NFS, VMstore), use the four-layer troubleshooting runbook and the API-driven troubleshooting guide.

SymptomLikely causeCheckFix
PVC Pending, event “waiting for first consumer”Normal with WaitForFirstConsumer; no pod uses it yetkubectl get pods -A -o wide | grep <claim>Create the pod. If a pod exists but is Pending for CPU or memory, fix scheduling first
PVC Pending, ProvisioningFailed: no compatible datastorePolicy matches nothing, the tag is missing from ds-tintri-01, or the datastore is not mounted on the hosts where the node VMs runGet-SpbmCompatibleStorage -StoragePolicy tintri-gold; controller logs: kubectl -n vmware-system-csi logs deploy/vsphere-csi-controller -c vsphere-csi-controllerTag the datastore; mount it on every host in the cluster
PVC Pending, ProvisioningFailed with a permission or authentication errorWrong password in the secret, or missing CNS privilegesController log; vCenter events for the service accountFix the roles (section 04); recreate the secret
Pod ContainerCreating, FailedAttachVolume with a timeoutvCenter cannot reach the host (443/902), host Not Responding, or a CNS task queue backlogHost connection state; recent tasks for the node VM in vCenterRestore vCenter-to-host connectivity; retry happens on its own
Multi-Attach error for volumeRWO volume still attached to the old node after a node failure or a forced pod movekubectl get volumeattachments | grep <pv>Bring the old node back or drain it properly. For a dead node, add the node.kubernetes.io/out-of-service taint so detach can proceed. Never edit VMs by hand
Attach fails on one node only, other nodes fineNode VM at its volume limit (59 with four PVSCSI controllers), or the node VM has a VM snapshotkubectl get csinode wk02 -o yaml (allocatable count); VM snapshots in vCenterSpread pods; remove the VM snapshot; check backup jobs that snapshot node VMs
FailedMount: MountVolume.MountDevice failed, disk not founddisk.EnableUUID not TRUE, so the guest cannot match the diskgovc vm.info -e wk02; ls /dev/disk/by-id on the nodeSet it and power-cycle the node VM
Stale CNS volumes: datastore fills, govc volume.ls longer than kubectl get pvRetain PVs deleted in Kubernetes, clusters torn down without deleting PVCs, or a reused cluster-idCompare govc volume.ls -l with PV volumeHandles; read the cluster ID in the CNS metadatagovc volume.rm after confirming; give every cluster a unique cluster-id
Option B: mount.nfs: access denied by serverNode IP not in the export ACL, wrong export path, or an NFS version the server does not offer to this clientshowmount -e <VMSTORE_GUEST_NFS_IP> (v3); rpcinfo -p; node IP on VLAN 31Add the node subnet to the export; set nfsvers to a supported version
Permission denied writing to the volumefsGroup missing; on NFS, root squash or a UID the export does not map; fsGroupChangePolicy slow on large volumeskubectl exec ... -- id; ls -ln /dataSet fsGroup; on NFS set mountPermissions or a matching UID; consider OnRootMismatch
App latency high, cluster healthyQoS ceiling on the node VM (shared by all its PVs), or contention on the VMstoreTrace script latency line: throttle or contention above zero; GET /v310/vm?name=wk02Remove or raise the node VM ceiling; spread hot PVs across nodes; see the QoS audit post
Expansion stuck, event mentions snapshotsCSI snapshots exist on the volume, or the node VM has a VM snapshotkubectl get volumesnapshot -A filtered by source PVCDelete the snapshots; expand; snapshot again
Restore PVC Pending, ProvisioningFailedDifferent StorageClass or datastore from the snapshot, or a size other than restoreSizeCompare the PVC with the snapshot status.restoreSizeSame class, exact size; expand after
Clone PVC rejected: unsupported content sourcePVC-to-PVC clone is not supported by vSphere CSIEvent on the PVCSnapshot, restore, delete the snapshot
newman: requests “skipped” in Postman but run in newman (or the reverse)newman older than 6.1.0 ignores skipRequestnewman --versionUpgrade to 6.2.3

17. What’s next

For the design behind these choices (platform, storage path, tiers, QoS, DR and sizing) go to the solutions architect’s design guide. For the storage side as an API, read the VMstore REST API guide. API-driven troubleshooting builds a correlated timeline from vCenter and the VMstore, the vSphere Automation REST API deploy guide builds the cluster underneath, and the vSphere on Tintri design guide explains the datastore and QoS decisions these volumes inherit. The network design, VMstore for vSphere and troubleshooting runbook parts of the joint series cover the layers under figure 3.

On the Kubernetes side, the vSphere Kubernetes Service tutorial sets up VKS. OpenTelemetry for vSphere admins, part 5 and OpenTelemetry on OpenShift on vSphere add the observability layer. The stateful OpenShift on Tintri NFS post is the OpenShift version of this build. For latency work, correlating vSphere and VMstore latency in one table, per-VM latency from the VMstore API and the QoS audit take the trace script’s last line further, and NFSv3 and NFSv4.1 in vSphere covers the protocol under all of it.

Leave a Reply