While doing some testing on ghettoVCB earlier this week, I noticed a new command line argument to vmkfstools utility called "--fix" in vSphere 4.1. From the man pages for vmkfstool, it states the following:
-x, --fix -[check|repair]
This option will check and/or repair the virtual disk in case of an unclean shutdown.
Here is an example of running the command against a VM's VMDK:
[root@esx4-1 ~]# vmkfstools --fix check /vmfs/volumes/esx4-1-local-storage-1/dummy/dummy.vmdk
Disk is error free
What surprised me next while looking up this new parameter in the man pages, I discovered another new argument called "--miscop":
-J, --miscop [setuuid | getuuid]
´setuuid´ option creates a unique identifier (UUID) for the
virtual disk and stores the UUID in the descriptor file of the
virtual disk. If the descriptor file already contains a UUID,
it will be overwritten with a new one. Please make sure that the
virtual disk does not have a UUID before using this option.
´getuuid´ option displays the UUID of the virtual disk.
The "--miscop" command is listed in the man pages but is not displayed when running "vmkfstools --help".
At this point, I thought there might be more hidden commands that VMware is holding out on us. I decided to use a well known UNIX/Linux utility called "strings" which looks for printable string in files and apply that to the vmkfstools binary. After sifting through the massive output, I found the following additional command line parameters that are not documented:
- dumpfs
- numfiles
- force
- recursivelock
- recover
- vmfsscan
- physicalmapping
- logicalmapping
- allocateblock
- clearlazyzero
- parseimage
- createarro
- createmirrordisks
- createmultiextent
- trackvdisk
- activehosts
Here are some of the command syntax which I have been able to verify:
dumpfs can be used by specifying either "-D | --dumpfs" and specifying a VMFS volume, file or folder.
[root@esx4-1 ~]# vmkfstools -D /vmfs/volumes/esx4-1-local-storage-1/
Lock [type 10c00001 offset 4292608 v 33, hb offset 3440640
gen 11, mode 0, owner 00000000-00000000-0000-000000000000 mtime 2509]
Addr <4, 0, 0>, gen 1, links 4, type dir, flags 0, uid 0, gid 0, mode 1755
len 1260, nb 1 tbz 0, cow 0, zla 1, bs 1048576
[root@esx4-1 ~]# vmkfstools --dumpfs /vmfs/volumes/esx4-1-local-storage-1/
Lock [type 10c00001 offset 4292608 v 33, hb offset 3440640
gen 11, mode 0, owner 00000000-00000000-0000-000000000000 mtime 2509]
Addr <4, 0, 0>, gen 1, links 4, type dir, flags 0, uid 0, gid 0, mode 1755
len 1260, nb 1 tbz 0, cow 0, zla 1, bs 1048576
activehosts can be used by specifying "--activehosts" and specifying a VMFS volume
[root@esx4-1 ~]# vmkfstools --activehosts /vmfs/volumes/esx4-1-local-storage-1/
Found 1 actively heartbeating hosts on volume '/vmfs/volumes/esx4-1-local-storage-1/'
(1): MAC address 00:50:56:92:3f:86
For the other parameters, I have not been able to figure out the additional arguments to make them work. If anyone or VMware has further insight into these other options, I would love to know what they are used for.
Anonymous says
Cool! Thanks.
geeksilver says
Wow. That's a amazing you can do that.
Thank you for your info.
http://geeksilver.wordpress.com
Thomas King says
That just saved my bacon, thanks!