Home > Clouding, IT Architecture, VMware Cloud > vsphere esxi tips

vsphere esxi tips

July 1st, 2013
vicfg-<esxcfg- deprecated> and other vCLI commands, include ESXCLI<from the server with vCLI package installed OR from the vMA virtual machine OR through vcenter server<-vihost parameter>>
esxcli<better use vCLI or PowerCLI instead. directly from esxi shell<console> OR from the server with vCLI package installed OR from the vMA virtual machine OR from vsphere PowerCLI prompt by using Get-EsxCli> OR through vcenter server<-vihost parameter>
localcli <localcli commands are equivalent to ESXCLI commands, but bypass hostd. The localcli commands are only for situations when hostd is unavailable and cannot be restarted. After you run a localcli command, you must restart hostd. Run ESXCLI commands after the restart. If you use a localcli command in other situations, an inconsistent system state and potential failure can result.>
PowerCLI cmdlets<windows powershell>
Some examples:
vicfg-hostops <conn_options> --operation shutdown --force
vicfg-hostops <conn_options> --operation shutdown --cluster <my_cluster>
vmware-cmd --config esxhome.cfg -l
vmware-cmd --config esxhome.cfg '/vmfs/volumes/505f5efb-38f8b83f-e1ce-1c6f65d2477b/OracleLinux/OracleLinux.vmx' getuptime
esxcli [options] {namespace}+ {cmd} [cmd options]
esxcli --config esxhome.cfg network ip interface list
esxcli --config esxhome.cfg fcoe adapter list
esxcli --config esxhome.cfg storage nfs add -H <hostname> -s <sharepoint> -v <volumename>
esxcli --config esxhome.cfg --formatter=csv network ip interface list
esxcli --config esxhome.cfg --reason <reason> system shutdown poweroff <must be in maintenance mode>
esxcli --config esxhome.cfg --reason <reason> system shutdown reboot
esxcli <conn_options> system maintenanceMode set --enable true
~ # esxcli vm process list
World ID: 35425
Process ID: 0
VMX Cartel ID: 35356
UUID: 42 29 c5 ae 06 c7 19 f2-1e 85 88 eb 3f 19 6f 65
Display Name: UCF-ZFS001
Config File: /vmfs/volumes/5739ec95-8876d0ed-193d-0010e03ca4e8/UCF-ZFS001/UCF-ZFS001.vmx
~ # vim-cmd vmsvc/getallvms
Vmid Name File Guest OS Version Annotation
2 UCF-ZFS001 [hyper01] UCF-ZFS001/UCF-ZFS001.vmx solaris11_64Guest vmx-10 Oracle
Good Luck!

Comments are closed.