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.

You will need to change the server address for your ESXi host and also insetr the correct password.

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

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

Disable DelayedAck:
esxcli --server= --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= --username root --password "password" iscsi adapter param set -A vmhba33 -k LoginTimeout -v 60

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

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

Establish if NetQ is enabled:

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

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

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

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

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

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

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

Install a patch on a host after using SCP to copy it to the path below :
esxcli --server= --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= --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= --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= --username root --password "password" storage nmp psp roundrobin deviceconfig set -d naa.devicename --iops 1 --type iops

Install a bundle:
esxcli --server= --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