When searching an issue on expanding a shared disk on Microsoft clustering VMs (CIB), I have learned more about the vmkfstools command.
The vmkfstools --help displays many options, but lack of explanation. So I document them here. (reference: vSphere Storage, Using vmkfstools)
# vmkfstools --help
OPTIONS FOR FILE SYSTEMS:
vmkfstools -C --createfs [vmfs3|vmfs5]
-b --blocksize #[mMkK]
-S --setfsname fsName
-Z --spanfs span-partition
-G --growfs grown-partition
deviceName
-P --queryfs -h --humanreadable
-T --upgradevmfs
vmfsPath
-y --reclaimBlocks vmfsPath [--reclaimBlocksUnit #blocks]
OPTIONS FOR VIRTUAL DISKS:
vmkfstools -c --createvirtualdisk #[gGmMkK]
-d --diskformat [zeroedthick
|thin
|eagerzeroedthick
]
-a --adaptertype [buslogic|lsilogic|ide
|lsisas|pvscsi]
-W --objecttype [file|vsan]
--policyFile <fileName>
-w --writezeros
-j --inflatedisk
-k --eagerzero
-K --punchzero
-U --deletevirtualdisk
-E --renamevirtualdisk srcDisk
-i --clonevirtualdisk srcDisk
-d --diskformat [zeroedthick
|thin
|eagerzeroedthick
|rdm:<device>|rdmp:<device>
|2gbsparse]
-W --object [file|vsan]
--policyFile <fileName>
-N --avoidnativeclone
-X --extendvirtualdisk #[gGmMkK]
[-d --diskformat eagerzeroedthick]
-M --migratevirtualdisk
-r --createrdm /vmfs/devices/disks/...
-q --queryrdm
-z --createrdmpassthru /vmfs/devices/disks/...
-v --verbose #
-g --geometry
-x --fix [check|repair]
-e --chainConsistent
-Q --objecttype name/value pair
--uniqueblocks childDisk
vmfsPath
OPTIONS FOR DEVICES:
-L --lock [reserve|release|lunreset|targetreset|busreset|readkeys|readresv
] /vmfs/devices/disks/...
-B --breaklock /vmfs/devices/disks/...
vmkfstools -H --help
vmkfstools Command Syntax
vmkfstools options target
Options: separate into three types - File System Options, Virtual Disk Options, and Storage Device Options.
Target: partition, device, or path
File System Options
- Listing Attributes of a VMFS Volume
The listed attributes include the file system label, if any, the number of extents comprising the specified VMFS volume, the UUID, and a listing of the device names where each extent resides.
vmkfstools -P -h <vmfsVolumePath>
vmkfstools -P -h /vmfs/volumes/netapp_sata_nfs1/ - Creating a VMFS Datastore
vmkfstools -C vmfs5 -b <blocksize> -S <datastoreName> <partitionName>
vmkfstools -C vmfs5 -b 1m -S my_vmfs /vmfs/devices/disks/naa.ID:1 - Extending an Existing VMFS Volume
vmkfstools -Z <span_partition> <head_partition>
vmkfstools -Z /vmfs/devices/disks/naa.disk_ID_2:1 /vmfs/devices/disks/naa.disk_ID_1:1
Caution: When you run this option, you lose all data that previously existed on the SCSI device you specified in span_partition. - Growing an Existing Extent
vmkfstools –G device device
vmkfstools --growfs /vmfs/devices/disks/disk_ID:1 /vmfs/devices/disks/disk_ID:1
Virtual Disk Options
Storage Device Options
- Managing SCSI Reservation of LUNs
Caution: Using the -L option can interrupt the operations of other servers on a SAN. Use the -L option only when troubleshooting clustering setups. - vmkfstools -L reserve <deviceName>
Reserves the specified LUN. After the reservation, only the server that reserved that LUN can access it. If other servers attempt to access that LUN, a reservation error results - vmkfstools -L release <deviceName>
Releases the reservation on the specified LUN. Other servers can access the LUN again - vmkfstools -L lunreset <deviceName>
Resets the specified LUN by clearing any reservation on the LUN and making the LUN available to all servers again. The reset does not affect any of the other LUNs on the device. If another LUN on the device is reserved, it remains reserved - vmkfstools -L targetreset <deviceName>
Resets the entire target. The reset clears any reservations on all the LUNs associated with that target and makes the LUNs available to all servers again. - vmkfstools -L busrest <deviceName>
Resets all accessible targets on the bus. The reset clears any reservation on all the LUNs accessible through the bus and makes them available to all servers agai - When entering the device parameter, use the following format:
/vmfs/devices/disks/vml.vml_ID:P
Hidden Options (reference: “Some useful vmkfstools ‘hidden’ options”)
- VMDK Block Mappings
vmkfstools -t0 <vmdkFile>
Display the chuck file format in a VMDK file. - VMFS -- = eager zeroed thick
- VMFS Z- = lazy zeroed thick
- NOMP -- = thin