Miscelaneous ESXi commands I need when dealing with storage from time to time.

Steps

[root@esx01:~] esxcli storage filesystem list
Mount Point                                        Volume Name                  UUID                                 Mounted  Type            Size          Free
-------------------------------------------------  ---------------------------  -----------------------------------  -------  ------  ------------  ------------
/vmfs/volumes/5daaf077-dbf3b03d                    FreeNAS NFS                  5daaf077-dbf3b03d                      false  NFS                0             0
/vmfs/volumes/54c9ae83-f5a9bff3-0ca5-002590c350e6  esx01_storage                54c9ae83-f5a9bff3-0ca5-002590c350e6     true  VMFS-5  491505319936  490482958336
/vmfs/volumes/575e0ef3-1454586c-4f14-001ec9acaaab  snap-21bc45c7-FreeNAS-zvol1  575e0ef3-1454586c-4f14-001ec9acaaab     true  VMFS-5  697663750144  325037588480
/vmfs/volumes/575d83e2-cb2e24ad-5a16-002590c350e6                               575d83e2-cb2e24ad-5a16-002590c350e6     true  vfat      4293591040    4261216256
/vmfs/volumes/5a593c75-89dadb80-e5fa-7fde4815752f                               5a593c75-89dadb80-e5fa-7fde4815752f     true  vfat       261853184      59961344
/vmfs/volumes/95672572-5971299d-1c3f-4f6f8921a421                               95672572-5971299d-1c3f-4f6f8921a421     true  vfat       261853184      73351168
/vmfs/volumes/54c9ae7d-6526972b-5525-002590c350e6                               54c9ae7d-6526972b-5525-002590c350e6     true  vfat       299712512      87310336
[root@esx01:~] esxcli storage nfs list
Volume Name  Host            Share                      Accessible  Mounted  Read-Only   isPE  Hardware Acceleration
-----------  --------------  -------------------------  ----------  -------  ---------  -----  ---------------------
FreeNAS NFS  freenas.cmhome  /mnt/cess/virtualmachines       false    false      false  false  Unknown
[root@esx01:~] ping 192.168.3.250
PING 192.168.3.250 (192.168.3.250): 56 data bytes
64 bytes from 192.168.3.250: icmp_seq=0 ttl=63 time=0.222 ms

--- 192.168.3.250 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 0.222/0.222/0.222 ms
[root@esx01:~] esxcli storage filesystem unmount -l "FreeNAS NFS"
Volume 'FreeNAS NFS' is not mounted
[root@esx01:~] esxcli storage filesystem mount -l "FreeNAS NFS"
[root@esx01:~] esxcli storage nfs list
Volume Name  Host            Share                      Accessible  Mounted  Read-Only   isPE  Hardware Acceleration
-----------  --------------  -------------------------  ----------  -------  ---------  -----  ---------------------
FreeNAS NFS  freenas.cmhome  /mnt/cess/virtualmachines        true     true      false  false  Not Supported
[root@esx01:~] ping 192.168.3.14
PING 192.168.3.14 (192.168.3.14): 56 data bytes

--- 192.168.3.14 ping statistics ---
2 packets transmitted, 0 packets received, 100% packet loss
[root@esx01:~]
esxcli storage nfs add --host=freenas.cmhome --share=/mnt/cess/virtualmachines --volume-name="FreeNAS NFS"

VMware commands

vim-cmd solo/registervm /vmfs/volumes/datastore_name/VM_directory/VM_name.vmx
vim-cmd vmsvc/getallvms
vim-cmd vmsvc/power.on <vm id>
vim-cmd vmsvc/power.getstate <vm id>
for id in `vim-cmd vmsvc/getallvms | awk '{print $1}' | egrep -iv 'vmid|version'` ; do vim-cmd vmsvc/reload $id; done

Footnotes and References