Troubleshoot TCP connection issues from the ESX Service Console


If you need to troubleshoot TCP connection issues from your ESX host. You will notice that Telnet isn’t available on your ESX host. But VMware posted a workaround in KB1010747. The reason why VMware did not include the Telnet package is simple:

The TELNET package does not ship with the ESX service console. While the TELNET daemon is clearly a security risk, the TELNET client may be a useful tool in diagnosing TCP session connectivity between the ESX Service Console and TCP ports on a foreign host.

The workaround is a Python script. You can copy the following script to your ESX host and place it in /tmp directory.

#!/usr/bin/python
# TCP connection "tester" -
# provide the hostname/IP address followed by port number (if no port
# is specified, 23 is assumed ;)
# program will connect to the port and read till either it receives a
# newline or 5 seconds expire
# be sure to chmod 755
import sys
import telnetlib
import socket

PORT = ""
argc = len(sys.argv)

if argc == 3 :
    PORT = sys.argv[2]
elif argc < 2 or argc > 3:
    print "usage %s host <port> \n" % sys.argv[0]
    sys.exit()

HOST = sys.argv[1]

try:
    tn = telnetlib.Telnet(HOST,PORT)
except socket.error, (errno, strerror):
    print " SockerError( %s ) %s\n" %  (errno, strerror)
    sys.exit()

print tn.read_until("\n ",5)
print "connection succeeded\n"
tn.close()
sys.exit()

If you want to test if a particular TCP port is reachable from your ESX host. You can use the script like this:

[root@esx01 ~]# ./testtcp vc01.ict-freak.loc 443

connection succeeded

[root@esx01 ~]#

In case the TCP port is not reachable from your ESX host. The script will just hang on your command and will eventually time out:

[root@esx01 ~]# ./testtcp vc01.ict-freak.loc 443
SockerError( 110 ) Connection timed out

You can also cancel the script by pressing CTRL + C

I didn’t test the script from ESXi. If you did, please leave a comment.

Source: KB1010747
Advertisement

VMware: Service Console Memory


Als je ESX 3.x standaard installeerd krijgt het Service Console 272 MB geheugen.

image

Via fdisk –l  kun je de partitie informatie opvragen. Zoals je ziet heeft deze ESX server een Swap partitie van 1600MB. 

image

Standaard is de Swap partitie 544MB (2*272mb van het Service Console).  Mocht de swap partitie inderdaad “maar” 544mb groot zijn, dan kun je het geheugen van het Service Console niet verhogen. Hoe je dit verder kan oplossen lees je hier: http://communities.vmware.com/message/685697#685697

Je kunt het gehugen van het Service Console op twee manieren aanpassen, via de de VIC of via de commandline.

Via de VIC

klik op properties.

image

Voer daarna de juiste waarde in (800MB is de max):

image

 

Vanaf het Service Console

Via het onderstaande commando kun je opvragen hoeveel geheugen er voor het Service Console geconfigureerd is.

[root@esxserver root]# cat /etc/vmware/esx.conf | grep -i "memSize"
/boot/memSize = "272"

Als je dit wilt ophogen naar 800MB kun je dat doen via het commando:

vmware-vim-cmd hostsvc/memoryinfo 838860800 (http://communities.vmware.com/thread/173359)

Daarna even kijken of de settings is doorgevoerd.

[root@esxserver root]# cat /etc/vmware/esx.conf | grep -i "memSize"
/boot/memSize = "800"

 

Via de VI Toolkit:

$consoleMemMb = 800
Get-VMHost | Get-View | %{(Get-View -Id $_.ConfigManager.MemoryManager).ReconfigureServiceConsoleReservation($consoleMemMb*1mb)}
Thanks to LucD: http://communities.vmware.com/

De bovenstaande code past de setting aan op al je ESX servers in je VirtualCenter.

image

En in de VIC kun je zien dat de settings is aangepast en een herstart nodig is.

image