Tuesday, 7 May 2013

Useful ESXCFG commands

To run any of these commands on you local machine you will need vSphere CLI 5.1 of higher.

https://my.vmware.com/web/vmware/details?downloadGroup=VSP510-VCLI-51U1&productId=285
You will need to change the server address 0.0.0.0 for your ESXi host and also insetr the correct password.

Enter maintenance mode:
vicfg-hostops.pl --server=0.0.0.0 --username root --password "password" --operation enter

Reboot a host:
vicfg-hostops.pl --server=0.0.0.0 --username root --password "password" --operation reboot

Disable DelayedAck:
esxcli --server=0.0.0.0 --username root --password "password" iscsi adapter param set --adapter=vmhba33 --key=DelayedAck --value=false

Set the iSCSI login time out to 60 seconds:
esxcli --server=0.0.0.0 --username root --password "password" iscsi adapter param set -A vmhba33 -k LoginTimeout -v 60

List the values for the SWiSCSI HBA:
esxcli --server=0.0.0.0 --username root --password "password" iscsi adapter param get -A=vmhba33

Find the iQN name of a host:
esxcli --server=0.0.0.0 --username root --password "password" iscsi adapter get -A vmhba33 | find "iqn"

Establish if NetQ is enabled:

esxcli --server=0.0.0.0 --username root --password "password" system settings kernel list | find "netNet"

Find the version of Broadcom driver:
esxcli --server=0.0.0.0 --username root --password "password" system module get -m tg3

List all NICs in a host , like 'esxcfg-nics -l'
esxcli --server=0.0.0.0 --username root --password "password" network nic list

Disable LRO on a host:
esxcli --server=0.0.0.0 --username root --password "password" system settings advanced set -o "/Net/TcpipDefLROEnabled" -i 0


See if LRO is enabled on a host:
esxcli --server=0.0.0.0 --username root --password "password" system settings advanced list -o "/Net/TcpipDefLROEnabled"

Add a time server to a host:
vicfg-ntp.pl --server=0.0.0.0 --username root --password "password" --add 0.uk.pool.ntp.org

Specify a syslog server :
esxcli --server=0.0.0.0 --username root --password "password" system syslog config set --logdir-unique true --loghost=udp://0.0.0.0:514

Install a patch on a host after using SCP to copy it to the path below :
esxcli --server=0.0.0.0 --username root --password "password" software vib install -d /vmfs/volumes/esxiserver/BCM-NetXtremeII-4.0-offline_bundle-862948.zip

Set the PSP to RoundRobin and IOPS to 3 for EqualLogic arrays:
esxcli --server=0.0.0.0 --username root --password "password" storage nmp satp rule add -s "VMW_SATP_EQL" -V "EQLOGIC" -M "100E-00" -P "VMW_PSP_RR" -O "iops=3"

Verify the IOPS have been saved
esxcli --server=172.26.253.185 --username root --password "P@ssw0rd" storage nmp device list | find "iops"

Set the PSP to RoundRobin and IOPS to 1 for other arrays:
esxcli --server=0.0.0.0 --username root --password "password" storage nmp psp roundrobin deviceconfig set -d naa.devicename --iops 1 --type iops

Install a bundle:
esxcli --server=0.0.0.0 --username root --password "password" software vib install -d /vmfs/volumes/esxi01/BCM-NetXtremeII-4.0-offline_bundle-862948.zip

Remember, don't issue these commands if you don't understand what they do!!

No comments:

Post a Comment