Bootstrap FreeKB - Trident - List Volumes
Trident - List Volumes

Updated:   |  Trident articles

This assumes you have installed the tridentctl command line tool. 

The tridentctl get volume command can be used to list the volumes that have been created on a Trident backend. In this example, two OpenShift Persistent Volume Claims (pvc) have been created. --namespace trident is used here when the Trident backend is running on an OpenShift pod in the "trident" project (namespace).

~]$ tridentctl get volume --namespace trident
+------------------------------------------+---------+---------------+----------+--------------------------------------+--------+---------+
|                   NAME                   |  SIZE   | STORAGE CLASS | PROTOCOL |             BACKEND UUID             | STATE  | MANAGED |
+------------------------------------------+---------+---------------+----------+--------------------------------------+--------+---------+
| pvc-a1034c77-08aa-41dd-ad59-f640b4324891 | 1.0 GiB | file-storage  | file     | f1975316-c73e-4d4e-bd15-c810e31fee10 | online | true    |
| pvc-ed142271-4155-4606-9c6f-35eef2d788dc | 1.0 GiB | file-storage  | file     | f1975316-c73e-4d4e-bd15-c810e31fee10 | online | true    |
+------------------------------------------+---------+---------------+----------+--------------------------------------+--------+---------+

 

Or, if running Trident in an OpenShift pod, the oc get pods command can be used to list the Trident pods.

~]$ oc get pods --namespace trident
NAME                           READY   STATUS    RESTARTS   AGE
trident-csi-28x7h              2/2     Running   0          7m12s
trident-csi-5fb5bb4886-gxh4s   6/6     Running   0          6m34s
trident-csi-8rmvd              2/2     Running   0          7m12s
trident-csi-cfdcq              2/2     Running   0          7m13s
trident-csi-gdm6n              2/2     Running   0          7m12s
trident-csi-mr682              2/2     Running   0          7m12s
trident-csi-qdr6v              2/2     Running   0          7m12s
trident-csi-rmvxx              2/2     Running   0          7m12s
trident-csi-tspz5              2/2     Running   0          7m12s
trident-csi-xfscd              2/2     Running   0          7m12s

 

And then the oc exec command can be used to list volumes.

~]$ oc exec trident-csi-5fb5bb4886-gxh4s --container trident-main --namespace trident -- tridentctl get volume
+------------------------------------------+---------+---------------+----------+--------------------------------------+--------+---------+
|                   NAME                   |  SIZE   | STORAGE CLASS | PROTOCOL |             BACKEND UUID             | STATE  | MANAGED |
+------------------------------------------+---------+---------------+----------+--------------------------------------+--------+---------+
| pvc-a1034c77-08aa-41dd-ad59-f640b4324891 | 1.0 GiB | file-storage  | file     | f1975316-c73e-4d4e-bd15-c810e31fee10 | online | true    |
| pvc-ed142271-4155-4606-9c6f-35eef2d788dc | 1.0 GiB | file-storage  | file     | f1975316-c73e-4d4e-bd15-c810e31fee10 | online | true    |
+------------------------------------------+---------+---------------+----------+--------------------------------------+--------+---------+

 

And here is an example of how you can display the details of a volume. 

~]$ tridentctl get volume pvc-ed142271-4155-4606-9c6f-35eef2d788dc --namespace trident --output yaml
items:
- Config:
    accessInformation:
      nfsPath: /trident_qtree_pool_k8s_BOFJMKJHRM/k8s_pvc_ed142271_4155_4606_9c6f_35eef2d788dc
      nfsServerIp: svm-0f47a227f90621ffc.fs-0adf810837c461d5d.fsx.us-east-1.amazonaws.com
      useCHAP: false
    accessMode: ReadWriteMany
    blockSize: ""
    cloneSourceSnapshot: ""
    cloneSourceVolume: ""
    cloneSourceVolumeInternal: ""
    encryption: ""
    fileSystem: ext4
    internalName: k8s_pvc_ed142271_4155_4606_9c6f_35eef2d788dc
    name: pvc-ed142271-4155-4606-9c6f-35eef2d788dc
    preferredTopologies:
    - topology.kubernetes.io/region: us-east-1
      topology.kubernetes.io/zone: us-east-1b
    - topology.kubernetes.io/region: us-east-1
      topology.kubernetes.io/zone: us-east-1c
    - topology.kubernetes.io/region: us-east-1
      topology.kubernetes.io/zone: us-east-1a
    protocol: file
    requisiteTopologies:
    - topology.kubernetes.io/region: us-east-1
      topology.kubernetes.io/zone: us-east-1a
    - topology.kubernetes.io/region: us-east-1
      topology.kubernetes.io/zone: us-east-1b
    - topology.kubernetes.io/region: us-east-1
      topology.kubernetes.io/zone: us-east-1c
    securityStyle: ""
    size: "1073741824"
    spaceReserve: ""
    splitOnClone: ""
    storageClass: file-storage
    version: "1"
    volumeMode: Filesystem
  backend: ""
  backendUUID: f1975316-c73e-4d4e-bd15-c810e31fee10
  orphaned: false
  pool: aggr1
  state: online

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 621b7d in the box below so that we can be sure you are a human.