1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

vSphere CSIで作成したPVの実体(vmdk)を確認する

Posted at

よく忘れるのでメモ。
vSphere CSIを利用して作成したPVの実体を見つける方法。

事前準備

適当にPVを作る。
作ったPVは以下。

$ kubectl get pv
NAME                                       CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS   CLAIM                                            STORAGECLASS   REASON   AGE
pvc-02f41402-9898-4a1e-a664-7c9c4fe0cf33   100Mi      RWO            Delete           Bound    testvelero/testvelero                            default                 12m

中身は以下。

$ kubectl get pv pvc-02f41402-9898-4a1e-a664-7c9c4fe0cf33 -o yaml
:(省略)
 csi:
    driver: csi.vsphere.vmware.com
    fsType: ext4
    volumeAttributes:
      storage.kubernetes.io/csiProvisionerIdentity: 1695574601389-8081-csi.vsphere.vmware.com
      type: vSphere CNS Block Volume
    volumeHandle: 3b3aa842-9608-4fe9-a079-8a84634b5ee7

確認

PowerCLIを使って確認する。まずPowerShellを起動する。

pwsh

vCenterにログインする。

Connect-VIServer wdc-10-220-153-123.nimbus.eng.vmware.com

ディスクの一覧を取得する。Get-vDisk-NameでPV名を渡すと対応するvmdkが取得できる。ft -autosizeをつけてPV名が分かるようにする。

PS /Users> Get-vDisk -Name pvc-02f41402-9898-4a1e-a664-7c9c4fe0cf33 | ft -autosize

Name                                     Disk Type CapacityGB                                                                                   Filename
----                                     --------- ----------                                                                                   --------
pvc-02f41402-9898-4a1e-a664-7c9c4fe0cf33 Flat      0.098      [vsanDatastore] faaec864-0315-3e67-0009-020017f7c942/48260b61e16e4fd4a667d9fd3b0db8fb.vmdk

これはデータストアの以下にあるものになる。
1695859584318.png

基本的にはfcd以下に格納される。fcd以下のどこのディレクトリに格納されるのかはよく分からない。

PVが持ってるvolumeHandleの値はidに相当するため、こちらから確認することも出来る。

PS /Users> (Get-vDisk -Name pvc-02f41402-9898-4a1e-a664-7c9c4fe0cf33).id
Datastore-datastore-31:3b3aa842-9608-4fe9-a079-8a84634b5ee7

参考文献:Finding VMDK path from PV VolumeHandle

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?