Skip to main content

Chris Engelbert Chris Engelbert

vmkfstools on Kubernetes: What Replaces Each Disk Operation

Oct 27, 2026  |  12 min read

vmkfstools on Kubernetes: What Replaces Each Disk Operation

The vmkfstools command is the ESXi shell tool for creating, cloning, converting, extending, renaming, and deleting virtual disks, and for managing VMFS datastores. On Red Hat® OpenShift® Virtualization and upstream KubeVirt, nothing replaces vmkfstools one to one. Each disk operation becomes a change to a Kubernetes object, carried out by the Containerized Data Importer (CDI), the CSI driver of your storage, or the guest operating system.

The map follows the virtual disk options in the VMware® vSphere 8.0 storage guide, then the VMFS options that have no counterpart. Moving whole VMs off vSphere is the job of the Migration Toolkit for Virtualization, covered in the storage decisions MTV makes for you.

The vmkfstools replacement, operation by operation

Table 1 maps each vmkfstools virtual disk option in the vSphere 8.0 storage guide to its replacement on OpenShift Virtualization and KubeVirt, and to who runs it.

vmkfstools optionWhat it did on ESXiReplacementWho does the work
-c createCreated an empty virtual disk on a datastoreA blank DataVolume (source: blank: {}) or a PVCYou declare it; the CSI driver provisions it
-w initializeWrote zeros over all of a disk’s data, erasing itNo counterpart for an existing disk; a new blank block DataVolume with preallocation: true is filled with zerosCDI
-i clone, with -d formatCopied a disk, optionally into another formatA DataVolume with a pvc sourceCDI, through the clone strategy in the StorageProfile
-i to re-importConverted disks from hosted products, such as 2gbsparse, into a format ESXi runsA CDI import or virtctl image-upload; CDI converts the image to rawCDI
-j inflate, -k eagerzeroAllocated and zeroed every block of a diskpreallocation: true when CDI writes the DataVolumeCDI
-K punchzeroDeallocated zeroed blocks and left a thin diskfstrim in the guest, passed down as discardsThe guest, then the storage system
-X extendGrew a disk to a new total sizeA larger spec.resources.requests.storage on the PVCThe CSI driver and KubeVirt; you grow the guest file system
-M upgradeConverted ESX Server 2 disk formats to the ESXi formatNo counterpartNobody
-E renameRenamed the disk fileNo rename: clone to the new name and repoint the VMYou
-U deleteDeleted the disk fileDelete the PVC; reclaimPolicy decides the volume’s fateYou delete it; the CSI driver removes or keeps the volume
-x check or repair, -e chain checkChecked or repaired a disk, and checked its snapshot chainVolume health from the storage system, file system checks in the guestThe storage system and the guest
-g geometryShowed cylinder, head, and sector geometryNo counterpart; kubectl get pvc and lsblk in the guestYou
-r, -z raw device mappingMapped a raw LUN to a file, -z with SCSI passthroughA PVC in Block volume mode, or a KubeVirt lun diskYou declare it; the CSI driver attaches it
-q query an RDMListed an RDM’s attributes, such as the raw disk’s name and IDkubectl get pvc names the bound PersistentVolume; kubectl get pv <pv-name> -o yaml shows its CSI driver and volumeHandleYou

On ESXi, these commands ran in the ESXi Shell. Broadcom’s guide notes that most of them do not need a root login, but a non-root user cannot clone a virtual disk or a raw device mapping (RDM), and file system commands might require root. On Kubernetes, RBAC decides who may create, clone, or delete a PVC in a namespace. Red Hat’s OpenShift 4.22 virtualization documentation states that users cannot clone resources between namespaces by default; a user with the cluster-admin role grants it with a new cluster role.

Clone and import: what replaces vmkfstools -i

To clone a disk on Kubernetes, you create a DataVolume with a pvc source, and CDI decides how the storage makes the copy. The upstream CDI documentation gives this clone example:

apiVersion: cdi.kubevirt.io/v1beta1
kind: DataVolume
metadata:
name: cloned-datavolume
spec:
source:
pvc:
namespace: source-ns
name: source-datavolume
storage: {}

CDI picks one of three clone strategies, set per StorageClass in the cloneStrategy field of its StorageProfile:

  • csi-clone: the CSI driver clones the volume through the CSI clone API, without an interim snapshot. Red Hat’s OpenShift 4.22 documentation says CDI uses it only when the StorageProfile specifies it.
  • snapshot: CDI creates a temporary VolumeSnapshot and restores it to a new PVC. It is the default when snapshots are configured.
  • copy: a source pod and a target pod copy the data over the network.

Set csi-clone when the CSI driver behind the StorageClass supports volume cloning. Otherwise, leave the default and let CDI use snapshot or copy. Among other prerequisites, the two efficient strategies need the same StorageClass and volume mode on source and target, and a source volume that is not in use. When a condition fails, CDI falls back to copy and records the reason in the cdi.kubevirt.io/cloneFallbackReason annotation on the target PVC. On ESXi, -N told vmkfstools to skip its native copy so a capable array could do the clone; cloneStrategy plays that role now.

Import replaces the other use of -i: bringing in a disk in a format ESXi could not run. CDI imports qcow2, VMDK, VDI, VHD, and VHDX images, and raw images either uncompressed or compressed with xz or gzip, and converts them all to raw. For a disk file on your workstation, virtctl image-upload creates the DataVolume and sends the file into it. The upload uses CDI scratch space, which doubles the storage it needs while it runs. An example with placeholder names:

Terminal window
virtctl image-upload dv <disk-name> --size=<size> \
--image-path=<path/to/disk.vmdk> --storage-class=<storage-class>

With simplyblock under the PVC, a clone is a copy-on-write operation. The new volume refers to the source’s data, so it is available at once, and extra capacity is needed for the changes made after cloning. The simplyblock CSI driver in 26.3 accepts a PVC as a clone dataSource. To send CDI clones down that path, set cloneStrategy: csi-clone in the StorageProfile of the simplyblock StorageClass. An example with a placeholder name:

Terminal window
kubectl patch storageprofile <storage-class> --type merge \
-p '{"spec":{"cloneStrategy":"csi-clone"}}'

One limit applies in 26.3: a logical volume clone cannot be resized, as the 26.3 known issues describe. Size a golden disk before you clone it, and request each clone at the source’s size. Running a golden-image catalog this way is covered in the VM template after the vSphere exit, and the wider design in storage for OpenShift Virtualization.

Thin, thick, and zeroed blocks: -j, -k, and -K become policy

On Kubernetes, -j, -k, and -K have no conversion command. The storage decides how space is allocated, CDI can preallocate when it writes a disk, and the guest returns free space with fstrim. On vSphere, zeroedthick, the default, allocated space at creation and zeroed blocks on first write; eagerzeroedthick zeroed them at creation; thin allocated space on demand. -j inflated a thin disk to eagerzeroedthick, -k converted zeroedthick to eagerzeroedthick, and -K deallocated zeroed blocks and left a thin disk.

Preallocation is CDI’s counterpart to inflating. Set preallocation: true in a DataVolume spec, or for every DataVolume in the spec.config of the CDI resource; it is off by default. CDI fills blank block volumes with zeros, and uses the qemu-img preallocation option (falloc where available, otherwise full) for blank, imported, and uploaded disk images. Red Hat describes the purpose as better write performance. CDI applies it when it writes a disk, so choose it at creation. For clones the documentation differs: the upstream CDI guide says a preallocated clone is filled in full, and Red Hat’s OpenShift 4.22 virtualization documentation says preallocation is ignored for cloning operations, so check the release you run.

Preallocation also switches off the replacement for -K. KubeVirt passes every disk to the guest with discard=unmap by default, so fstrim inside the guest tells the storage which blocks are free, and lsblk -D in the guest shows whether a disk accepts discards. For a preallocated DataVolume, CDI annotates the PVC with cdi.kubevirt.io/storage.preallocation: true, and KubeVirt disables discard passthrough for that disk. Choose preallocation when the workload needs the write-performance benefit and you accept losing discard passthrough on that disk. Keep the default when the guest must return space to the storage with fstrim.

On simplyblock, logical volumes are thin-provisioned: space is allocated when data is written. The documented 26.3 StorageClass parameters (pool, QoS, encryption, fabric, file system type, and others) include no thick-provisioning setting. Simplyblock’s documentation describes trimming as the step that tells the storage which blocks are unused, so it can release them. It recommends periodic trims, for example with fstrim.timer, and notes that the result depends on the file system, kernel support, and mount configuration.

The capacity guard a thick disk gave you moves to cluster-level capacity alerts. In the 26.3 limits reference, a warning fires when provisioned capacity passes 250 percent of cluster capacity, and volume creation fails past 500 percent. In the same 26.3 reference, used-capacity alerts fire at 89 and 99 percent, and all four values are defaults you can change. Whether zeros written by preallocation reserve space on a thin-provisioned pool depends on the storage, so measure it before you treat preallocation as a reservation. How shared thin capacity changes sizing is covered in VMware capacity planning after the exit.

Extend, rename, delete, and check

On Kubernetes, extending, deleting, and checking a VM disk are PVC and storage operations, and a PVC cannot be renamed.

Extend a disk (-X)

vmkfstools -X took the new total size, and Broadcom’s guide warns against extending the base disk of a VM that has snapshots. On Kubernetes you raise spec.resources.requests.storage on the PVC. If the StorageClass sets allowVolumeExpansion: true and the driver supports expansion, KubeVirt tells the VM about the new size, and the guest grows its partition and file system. Simplyblock expands logical volumes online in 26.3 and rounds each request up to the next full GiB. The full procedure is in how to expand a VM disk on OpenShift Virtualization.

Rename a disk (-E)

Kubernetes has no rename operation for a PVC. The name is how the API addresses the object, and the VM refers to its disk by that name, so a new name means a new PVC. Example steps:

  1. Stop the VM with virtctl stop <vm>, so the source volume is not in use and CDI can use an efficient clone.
  2. Create a DataVolume with the new name and the old PVC as its pvc source.
  3. Change the VM’s volume to the new name, then start the VM with virtctl start <vm>.
  4. Once the VM runs from the new disk, delete the old DataVolume, or the old PVC if no DataVolume owns it.

If the VM defines the disk in dataVolumeTemplates, make the change in that entry and in the volume that refers to it.

Delete a disk (-U)

Deleting the PVC replaces vmkfstools -U, and the StorageClass reclaimPolicy decides what happens to the volume. With Delete, the default, the volume goes with the claim. With Retain, the PersistentVolume stays in the Released state until you remove it with kubectl delete pv <pv-name>. On simplyblock, the storage behind a deleted volume is reclaimed only after all of its snapshots are deleted as well, so check for snapshots before you expect the capacity back.

Check and repair (-x, -e)

vmkfstools -x checked or repaired a corrupted virtual disk, and -e checked a snapshot chain for broken links or invalid parent-child relationships. On the destination there is no disk descriptor or delta file for you to inspect, so the check splits in two. The guest checks its own file system with its usual tools. The storage system reports volume health: on simplyblock, sbctl volume check <VOLUME_ID> returns a logical volume’s health and sbctl volume get-io-stats <VOLUME_ID> its I/O statistics. How snapshots change once they leave the VMDK chain is covered in VMware Snapshot Manager: what replaces it.

What has no replacement: the VMFS options

The VMFS options of vmkfstools have no replacement, because no datastore file system sits between OpenShift Virtualization and the storage: each VM disk is its own volume. -C created a VMFS datastore on a partition, -Z spanned it across another partition and erased that partition’s data, -G grew it after the device behind it grew, and -P listed its attributes and extents. All four managed the layer where many disk files shared one file system. The datastore decisions that remain are covered in what replaces the VMware datastore, and moving a disk to another StorageClass in what replaces vMotion and Storage vMotion.

On simplyblock, growing capacity means adding storage nodes to the cluster rather than growing a file system. In 26.3 you list the new workers in a StorageNodeSet with spec.expand: true. The cluster keeps serving I/O, and a low-priority rebalance then moves data onto the new devices. Among other preconditions, the expansion starts only when the cluster is active, every storage node is online, and no migration, node restart, or backup task is open. The documentation advises starting it while the cluster is not fully utilized.

You may also like:

Ephemeral Storage in Kubernetes: Why It Silently Breaks Stateful Workloads
Ephemeral Storage in Kubernetes: Why It Silently Breaks Stateful Workloads

emptyDir and other ephemeral storage look fast and simple, until a pod eviction or node failure erases the data. Here is what actually happens, and how NVMe/TCP persistent volumes give you the same latency without the risk.

NVMe Storage Cost Optimization in 2026: Erasure Coding, Thin Provisioning, and Compute Efficiency
NVMe Storage Cost Optimization in 2026: Erasure Coding, Thin Provisioning, and Compute Efficiency

NVMe drives deliver the performance Kubernetes stateful workloads need, but triple replication and thick provisioning multiply their cost fast. Here is a practical breakdown of erasure coding economics, thin provisioning, and how sub-millisecond latency reduces compute waste.

Kubernetes Storage 201: Concepts and Practical Examples
Kubernetes Storage 201: Concepts and Practical Examples

Kubernetes storage is a sophisticated ecosystem designed to address the complex data management needs of containerized applications. At its core, Kubernetes storage provides a flexible mechanism to…