Dell ESXI tweaks for EqualLogic SAN

change login timeout to 60
turn off delay AK

run the following:
ethtool –pause vmnic0 autoneg off tx on rx on
ethtool –pause vmnic1 autoneg off tx on rx on
ethtool –pause vmnic2 autoneg off tx on rx on
ethtool –pause vmnic3 autoneg off tx on rx on

then past the above into: /etc/rc.local.d/local.sh

Dell esxi script for esxi hosts using equalogic:

esxcli storage nmp satp set –default-psp=VMW_PSP_RR –satp=VMW_SATP_EQL ; for i in `esxcli storage nmp device list | grep EQLOGIC|awk ‘{print $7}’|sed ‘s/(//g’|sed ‘s/)//g’` ; do esxcli storage nmp device set -d $i –psp=VMW_PSP_RR ; esxcli storage nmp psp roundrobin deviceconfig set -d $i -I 3 -t iops ; done

ESXI: How to power on-off vms via cli

To power on a virtual machine from the command line:
List the inventory ID of the virtual machine with the command:

vim-cmd vmsvc/getallvms |grep <vm name>

Note: The first column of the output shows the vmid.

Check the power state of the virtual machine with the command:

vim-cmd vmsvc/power.getstate <vmid>

Power-on the virtual machine with the command:

vim-cmd vmsvc/power.on <vmid>

VMWare: How to add RDP rule to esxi firewall via cli

Sometimes I need to ssh jump to esxi host and tunnel RDP to an internal host across the ssh session

Backup:
cp /etc/vmware/firewall/service.xml /etc/vmware/firewall/service.xml.bak

chmod 644 /etc/vmware/firewall/service.xml

chmod +t /etc/vmware/firewall/service.xml

vi & enter towards the bottom of service.xml (below 0037):

<!– MY RDP –>
<service id=’0038′>
<id>myrdp</id>
<rule>
<direction>outbound</direction>
<protocol>tcp</protocol>
<porttype>dst</porttype>
<port>3389</port>
</rule>
<enabled>false</enabled>
<required>false</required>
</service>

chmod 444 /etc/vmware/firewall/service.xml

esxcli network firewall refresh

esxcli network firewall ruleset list

esxcli network firewall ruleset set -e true -r myrdp

Now feel free to RDP via ssh tunnel. I usually disable the rule after via:

esxcli network firewall ruleset set -e false -r myrdp

How to power off an unresponsive vm via cli

From: https://www.vladan.fr/esxi-5-unresponsive-vm-h/

Step 1 – connect via SSH by using puty for example and enter esxtop.

Enter “esxtop”, then press “c” for the CPU resource screen and shift + V to display VMs only.

ESXi 5 Unresponsive VM

Step 2 – changing the display and locating the LWID number

Press “f” to change the display fields and press “c” in order to show the LWID (Leader World Id) and press ENTER.

How to kill unresponsive VM in VMware ESXi 5

Step 3 – Invoking the k (kill) with the number does it…..

Now when you have the LWID column there, you can see the VM which interests you by the LWID number.

You can press “k” and enter the LWID number of the VM which you want to stop. Note that this is hard stop so, the next time that the VM will boot you’ll probbably see this screen (depending on your guest OS of course).

VMware ESXi 5 – How to kill an unresponsive VM through command line

If this method don’t work, you can’t vmotion the VM elsewhere or any other option don’t work either, there might be a hardware problem with the host which can lead into PSOD.

VMWare CLI: List VM’s, power on/off from cli and resize from cli

# vim-cmd vmsvc/getallvms
Vmid Name File Guest OS Version Annotation
1 QMain [ESX03] QMain/QMain.vmx windows8Server64Guest vmx-10
2 exch01 [ESX02] exch01/exch01.vmx winNetStandardGuest vmx-10
3 rdp01 [ESX02] rdp01/rdp01.vmx winNetStandardGuest vmx-10
4 VC02 [ESX01] VC02/VC02.vmx windows7Server64Guest vmx-10
5 tts1 [ESX01] tt1/tts1.vmx winNetStandardGuest vmx-10

~ # vim-cmd vmsvc/power.getstate 4
Retrieved runtime info
Powered off

~ # vmkfstools -X 100G /vmfs/volumes/ESX01/VC02/VC02.vmdk
Grow: 100% done.

~ # vim-cmd vmsvc/power.on 4
Powering on VM:

~ # vim-cmd vmsvc/getallvms
Vmid Name File Guest OS Version Annotation
1 QMain [ESX03] QMain/QMain.vmx windows8Server64Guest vmx-10
2 exch01 [ESX02] exch01/exch01.vmx winNetStandardGuest vmx-10
3 rdp01 [ESX02] rdp01/rdp01.vmx winNetStandardGuest vmx-10
4 VC02 [ESX01] VC02/VC02.vmx windows7Server64Guest vmx-10
5 tts1 [ESX01] tts1/tts1.vmx winNetStandardGuest vmx-10
~ #

Enable service in VMWare ESXI firewall

To list your current configuration:
# esxcli network firewall ruleset list

To enable sshClient to enable copying using ssh:

#esxcli network firewall ruleset set -e true -r sshClient

For older esxi versions (5 and below)
# esxcli network firewall ruleset set –ruleset-id sshClient –enabled yes

To refresh the configuration:
# esxcli network firewall refresh