Miscelaneous ESXi commands I need when dealing with storage from time to time.
Steps
1[root@esx01:~] esxcli storage filesystem list
2Mount Point Volume Name UUID Mounted Type Size Free
3------------------------------------------------- --------------------------- ----------------------------------- ------- ------ ------------ ------------
4/vmfs/volumes/5daaf077-dbf3b03d FreeNAS NFS 5daaf077-dbf3b03d false NFS 0 0
5/vmfs/volumes/54c9ae83-f5a9bff3-0ca5-002590c350e6 esx01_storage 54c9ae83-f5a9bff3-0ca5-002590c350e6 true VMFS-5 491505319936 490482958336
6/vmfs/volumes/575e0ef3-1454586c-4f14-001ec9acaaab snap-21bc45c7-FreeNAS-zvol1 575e0ef3-1454586c-4f14-001ec9acaaab true VMFS-5 697663750144 325037588480
7/vmfs/volumes/575d83e2-cb2e24ad-5a16-002590c350e6 575d83e2-cb2e24ad-5a16-002590c350e6 true vfat 4293591040 4261216256
8/vmfs/volumes/5a593c75-89dadb80-e5fa-7fde4815752f 5a593c75-89dadb80-e5fa-7fde4815752f true vfat 261853184 59961344
9/vmfs/volumes/95672572-5971299d-1c3f-4f6f8921a421 95672572-5971299d-1c3f-4f6f8921a421 true vfat 261853184 73351168
10/vmfs/volumes/54c9ae7d-6526972b-5525-002590c350e6 54c9ae7d-6526972b-5525-002590c350e6 true vfat 299712512 87310336
11[root@esx01:~] esxcli storage nfs list
12Volume Name Host Share Accessible Mounted Read-Only isPE Hardware Acceleration
13----------- -------------- ------------------------- ---------- ------- --------- ----- ---------------------
14FreeNAS NFS freenas.cmhome /mnt/cess/virtualmachines false false false false Unknown
15[root@esx01:~] ping 192.168.3.250
16PING 192.168.3.250 (192.168.3.250): 56 data bytes
1764 bytes from 192.168.3.250: icmp_seq=0 ttl=63 time=0.222 ms
18
19--- 192.168.3.250 ping statistics ---
201 packets transmitted, 1 packets received, 0% packet loss
21round-trip min/avg/max = 0.222/0.222/0.222 ms
22[root@esx01:~] esxcli storage filesystem unmount -l "FreeNAS NFS"
23Volume 'FreeNAS NFS' is not mounted
24[root@esx01:~] esxcli storage filesystem mount -l "FreeNAS NFS"
25[root@esx01:~] esxcli storage nfs list
26Volume Name Host Share Accessible Mounted Read-Only isPE Hardware Acceleration
27----------- -------------- ------------------------- ---------- ------- --------- ----- ---------------------
28FreeNAS NFS freenas.cmhome /mnt/cess/virtualmachines true true false false Not Supported
29[root@esx01:~] ping 192.168.3.14
30PING 192.168.3.14 (192.168.3.14): 56 data bytes
31
32--- 192.168.3.14 ping statistics ---
332 packets transmitted, 0 packets received, 100% packet loss
34[root@esx01:~]
1esxcli storage nfs add --host=freenas.cmhome --share=/mnt/cess/virtualmachines --volume-name="FreeNAS NFS"
VMware commands
1vim-cmd solo/registervm /vmfs/volumes/datastore_name/VM_directory/VM_name.vmx
1vim-cmd vmsvc/getallvms
1vim-cmd vmsvc/power.on <vm id>
2vim-cmd vmsvc/power.getstate <vm id>
1for id in `vim-cmd vmsvc/getallvms | awk '{print $1}' | egrep -iv 'vmid|version'` ; do vim-cmd vmsvc/reload $id; done
Comments