vmkfstools
CautionVMDK surgery
vmkfstools -X 200G <vm.vmdk>
Grows, clones and hole-punches VMDKs straight on the datastore — for vCenter-less hosts and GUI outages.
Examples
vmkfstools -i src.vmdk /vmfs/volumes/ds2/copy.vmdkClone a VMDKvmkfstools -i src.vmdk /vmfs/volumes/ds2/copy.vmdk -d thinClone as a thin-provisioned diskvmkfstools -K /vmfs/volumes/ds1/vm01/vm01.vmdkReclaim zeroed blocks, leaving a thin disk (VM powered off; not on NFS datastores)vmkfstools -e /vmfs/volumes/ds1/vm01/vm01.vmdkCheck the snapshot chain for consistency
Syntax
vmkfstools -X size <vmdk>(拡張) / -i src dst(クローン) / -K <vmdk>(ゼロ回収)
Key points
- Point it at the descriptor file (vm01.vmdk), not the -flat.vmdk.
- An extended disk cannot be shrunk, and the guest OS still has to grow its partition.
- Disks with snapshots cannot be extended. Consolidate the snapshots first.
When it does not work
- Specifying a size smaller than the current one fails. -X takes the new total size.
- Device or resource busy means the VM is powered on or another host holds the lock.
Before you run it
Triple-check VMDK paths.
Related commands
- esxcli storage filesystem listDatastore usage (ESXi)
- Resize-VHDGrow virtual disks
The same reference, with no signal at all
Every command on this site, held on your device. The app adds 632 more: 1,510 commands and 120 fix flows, searchable with no connection. Free to install, no ads (some content is a one-time purchase).
Get it free on the App Store