VMware ESXi command line

Following are some useful commands I'm using in daily management of VMware ESXi 5.5 servers.

Showing the ESXi Gateway alternate to "netstat -rn" in Linux: 

# esxcfg-route -l

Alternate to "arp" command in Linux:

# esxcli network ip neighbor list

List of all registered VMs:

 # vim-cmd vmsvc/getallvms

Restart the vpxa and ESXi host management agents:

# /etc/init.d/hostd restart
# /etc/init.d/vpxa restart

Restart all the mgmt services in the ESXi host:

# /sbin/services.sh restart

Restart VMware vCenter services:

Remote desktop to Windows vCenter server, in the services, restart "VMware VirtualCenter Server".
Same goes to restarting vCenter Inventory as well.

Alternate to "top" in Linux:

# esxtop 

Check ESXi version and update level:

#vmware -vl
   VMware ESXi 5.5.0 build-2068190
   VMware ESXi 5.5.0 Update 2

Listing the files that are opened and being used by VM:

# vmkvsitools lsof | grep vm_name 

Current state of a virtual machine:

# vim-cmd vmsvc/getallvms

Shutdown the VM using the VMID in previous step:

# vim-cmd vmsvc/power.getstate VMID
# vim-cmd vmsvc/power.shutdown VMID

Poweroff the VM in case it fails to shutdown:

# vim-cmd vmsvc/power.off VMID


Popular posts from this blog

Running Docker Wildfly/JBoss Application Server in Debug mode via Eclipse

Foreman fresh installation issue on Foreman proxy

Building RPM OpenSSH 7.1p1 on RHEL/CentOS 6.5