Thursday, 29 July 2010

Useful commands on ESX

After running into serious issues with stale VCB snapshots not committing properly, I'm making a note of useful command for future reference, as I can never remember these!

You can find all the snapshots on all the datastores visible from one host running this on the service console:

find /vmfs/volumes/ -name "*delta*" -type f -print0 | xargs -0 du --human-readable --total
Useful to see only the lines that you need from a .vmx or .vmdk file.

alias sgrep='egrep -i --color "scsi[0-9]+:[0-9]+.present | scsi.*filename | vmdk | parent | CID"'
To see the space available on all the Datastores

vdf -h
To see the space available in the Datastore we are located

vdf -h .
Is there a missing file? Look for it in all the Datastores.

find /vmfs/volumes/ -iname "*FILENAME*"

To see the evolution of the modifications on the files of the VM

watch -d "ls -lt *.vmdk ;date"
To have a nice colorful prompt
PS1='\[\e[0;31m\]\u@\h \W]$ \[\e[m\]\[\e[0;32m\]' ; export PS1

Thanks to Ruben @ VMUtils for this


Post a Comment