Some useful ESXi troubleshooting commands
Basic commands
===================
vim-cmd vmsvc/getallvms
Lists all vm's running on hypervisor and provides vmid
vim-cmd vmsvc/power.off vmid
Powers off vmid referenced from getallvms command
vim-cmd vmsvc/power.on vmid
Powers off vmid referenced from getallvms command
vim-cmd vmsvc/power.reboot vmid
Reboots vmid referenced from getallvms command
vim-cmd vmsvc/destroy vmid
Deletes the vmdk and vmx files from disk
vim-cmd hostsvc/maintenance_mode_enter
Puts hypervisor into maintenance mode
vim-cmd hostsvc/maintenance_mode_exit
Takes hypervisor out of maintenance mode
vim-cmd solo/registervm /vmfs/vol/datastore/dir/vm.vmx
Registers vm in hypervisor inventory
vim-cmd vmsvc/unregister vmid
Unregisters vm with hypervisor
vim-cmd vmsvc/tools.install vmid
Starts vmware tools installation for VM
vim-cmd hostsvc/net/info
Provides information about hypervisor networking
chkconfig -l
Shows daemons running on hypervisor. Can also be used for configuration.
esxtop
Same as linux top for vmware
vmkerrcode -l
List of vmkernel errors
esxcfg-info
Lists a LOT of information about the esx host
esxcfg-nics -l
Lists information about NIC's. Can also be used for configuration.
esxcfg-vswitch -l
Lists information about virtual switching. Can also be used for configuration.
dcui
Provides console screen to ssh session
vsish
Vmware interactive shell
decodeSel /var/log/ipmi_sel.raw
Read System Event Log of server
==========================
Network troubleshooting
==========================
esxcfg-nics -l to display NIC information and esxcfg-nics -h to display available options for this command
Set the speed and duplex of a NIC (vmnic2) to 100/Full:
esxcfg-nics -s 100 -d full vmnic2
Set the speed and duplex of a NIC (vmnic2) to autonegotiate:
esxcfg-nics -a vmnic2
esxcfg-vswif -l to display current settings and esxcfg-vswif -h to display all available options for changing settings.
Change your Service Console (vswif0) IP and subnet mask:
esxcfg-vswif -i 172.20.20.5 -n 255.255.255.0 vswif0
Add a Service Console (vswif0):
esxcfg-vswif -a vswif0 -p “Service Console” -i 172.20.20.40 -n 255.255.255.0
Type esxcfg-vswitch -l to display current vSwitch configurations and esxcfg-vswitch -h to display all available options for changing settings
Add a physical NIC (vmnic2) to a vSwitch (vSwitch1):
esxcfg-vswitch -L vmnic2 vswitch1
Remove a pNIC (vmnic3) from a vSwitch (vSwitch0):
esxcfg-vswitch -U vmnic3 vswitch0
Create a port group (VM Network3) on a vSwitch (vSwitch1):
esxcfg-vswitch -A “VM Network 3” vSwitch1
Assign a VLAN ID (3) to a port group (VM Network 3) on a vSwitch (vSwitch1):
esxcfg-vswitch -v 3 -p “VM Network 3” vSwitch1
esxcfg-route Sets or retrieves the default VMkernel gateway route.
Type esxcfg-route -l to display current routes and esxcfg-route -h to display all available options for
changing settings
Set the VMkernel default gateway route:
esxcfg-route 172.20.20.1
Add a route to the VMkernel:
esxcfg-route -a default 255.255.255.0 172.20.20.1
esxcfg-vmknic Creates and updates VMkernel TCP/IP settings for VMotion, NAS and iSCSI.
Type esxcfg-vmknic -l to display VMkernel NICs and esxcfg-vmknic -h to display all available options for
changing settings.
Add a VMkernel NIC and set the IP and subnet mask:
esxcfg-vmknic -a “VM Kernel” -i 172.20.20.19 -n 255.255.255.0
service network restart
===================
vim-cmd vmsvc/getallvms
Lists all vm's running on hypervisor and provides vmid
vim-cmd vmsvc/power.off vmid
Powers off vmid referenced from getallvms command
vim-cmd vmsvc/power.on vmid
Powers off vmid referenced from getallvms command
vim-cmd vmsvc/power.reboot vmid
Reboots vmid referenced from getallvms command
vim-cmd vmsvc/destroy vmid
Deletes the vmdk and vmx files from disk
vim-cmd hostsvc/maintenance_mode_enter
Puts hypervisor into maintenance mode
vim-cmd hostsvc/maintenance_mode_exit
Takes hypervisor out of maintenance mode
vim-cmd solo/registervm /vmfs/vol/datastore/dir/vm.vmx
Registers vm in hypervisor inventory
vim-cmd vmsvc/unregister vmid
Unregisters vm with hypervisor
vim-cmd vmsvc/tools.install vmid
Starts vmware tools installation for VM
vim-cmd hostsvc/net/info
Provides information about hypervisor networking
chkconfig -l
Shows daemons running on hypervisor. Can also be used for configuration.
esxtop
Same as linux top for vmware
vmkerrcode -l
List of vmkernel errors
esxcfg-info
Lists a LOT of information about the esx host
esxcfg-nics -l
Lists information about NIC's. Can also be used for configuration.
esxcfg-vswitch -l
Lists information about virtual switching. Can also be used for configuration.
dcui
Provides console screen to ssh session
vsish
Vmware interactive shell
decodeSel /var/log/ipmi_sel.raw
Read System Event Log of server
==========================
Network troubleshooting
==========================
esxcfg-nics -l to display NIC information and esxcfg-nics -h to display available options for this command
Set the speed and duplex of a NIC (vmnic2) to 100/Full:
esxcfg-nics -s 100 -d full vmnic2
Set the speed and duplex of a NIC (vmnic2) to autonegotiate:
esxcfg-nics -a vmnic2
esxcfg-vswif -l to display current settings and esxcfg-vswif -h to display all available options for changing settings.
Change your Service Console (vswif0) IP and subnet mask:
esxcfg-vswif -i 172.20.20.5 -n 255.255.255.0 vswif0
Add a Service Console (vswif0):
esxcfg-vswif -a vswif0 -p “Service Console” -i 172.20.20.40 -n 255.255.255.0
Type esxcfg-vswitch -l to display current vSwitch configurations and esxcfg-vswitch -h to display all available options for changing settings
Add a physical NIC (vmnic2) to a vSwitch (vSwitch1):
esxcfg-vswitch -L vmnic2 vswitch1
Remove a pNIC (vmnic3) from a vSwitch (vSwitch0):
esxcfg-vswitch -U vmnic3 vswitch0
Create a port group (VM Network3) on a vSwitch (vSwitch1):
esxcfg-vswitch -A “VM Network 3” vSwitch1
Assign a VLAN ID (3) to a port group (VM Network 3) on a vSwitch (vSwitch1):
esxcfg-vswitch -v 3 -p “VM Network 3” vSwitch1
esxcfg-route Sets or retrieves the default VMkernel gateway route.
Type esxcfg-route -l to display current routes and esxcfg-route -h to display all available options for
changing settings
Set the VMkernel default gateway route:
esxcfg-route 172.20.20.1
Add a route to the VMkernel:
esxcfg-route -a default 255.255.255.0 172.20.20.1
esxcfg-vmknic Creates and updates VMkernel TCP/IP settings for VMotion, NAS and iSCSI.
Type esxcfg-vmknic -l to display VMkernel NICs and esxcfg-vmknic -h to display all available options for
changing settings.
Add a VMkernel NIC and set the IP and subnet mask:
esxcfg-vmknic -a “VM Kernel” -i 172.20.20.19 -n 255.255.255.0
service network restart
Comments
Post a Comment