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
------------------------------------
Update Patches or ESXI upgrade through Command Line
#vim-cmd hostsvc/maintenance_mode_enter
#esxcli software vib install -d "/vmfs/volumes/datastore1/patch-directory/ESXi500-201111001.zip"
#esxcli software vib install -v https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/esx/vmw/vib20/tools-light/VMware_locker_tools-light_5.0.0-0.7.515841.vib
###Verify that the VIBs are installed on your ESXi host:
#esxcli software vib list
After the patch has been installed, reboot the ESX host:
# reboot
After the host has finished booting, exit maintenance mode and power on the virtual machines:
# vim-cmd hostsvc/maintenance_mode_exit
===========================================================================
Below is a list of most common CLI commands for VMWare ESXi. Type these in directly in an ESXi or SSH shell.
vim-cmd vmsvc/getallvms | List all VMs running on the host. Also provides vmid, required for commands below. |
vim-cmd vmsvc/power.off vmid | Power off specified VM. |
vim-cmd vmsvc/power.on vmid | Power off specified VM. |
vim-cmd vmsvc/power.reboot vmid | Reboot specified VM. |
vim-cmd solo/registervm /vmfs/volume/datastore/subdir/vm-file.vmx | Register the VM stored at location on the ESX host inventory. |
vim-cmd vmsvc/unregister vmid | Unregister VM from the host. Does not remove the VM's files from the datastore. |
vim-cmd vmsvc/destroy vmid | Delete the specified VM. The VMDK and VMX files will be deleted from storage as well. |
vim-cmd vmsvc/tools.install vmid | Initiates an installation of VMWare Tools on the VM |
vim-cmd hostsvc/maintenance_mode_enter | Put the host into maintenance mode. |
vim-cmd hostsvc/maintenance_mode_exit | Take the host out of maintenance mode. |
vim-cmd hostsvc/net/info | Show networking information of the host. |
chkconfig -l | Show services running on the host. Can also be used to change startup configuration. |
esxtop | Display list of processes and its usage of resources. Works similar to linux top. |
esxcfg-info | Show host's configuration and information. |
esxcfg-nics -l | Show current NIC configuration. |
esxcfg-vswitch -l | Show current vSwitch configuration. |
vmkerrcode -l | Display a reference list of VMKernel return codes and descriptions. |
dcui | Start the console UI (when accessing through SSH). |
vsish | Run the VMWare Interactive Shell (from SSH). |
decodeSel /var/log/ipmi_sel.raw | Read IPMI system log of physical server. |
Replace vmid with the value you retrieved from the getallvms command (first one in the table).
Replace path with the full path and file name of a VMX-file (= configuration file of a VM).
---------
No comments:
Post a Comment