Details
Service console IP address is set to DHCP
vmkernel default route is set to 0.0.0.0 after reboot of ESX server
Failed to establish connection to iscsi targets, vmkernel logs the following errors
iSCSI: bus 0 target 0 trying to establish session 0x6943af8 to portal 0, address xx.xx.xx.xx port
iSCSI: session 0x6943af8 to iqn.YYY-MM.com.array:sn.50412358 failed to connect, rc -5, I/O error
iSCSI: session 0x6943af8 connect failed at xxxx
iSCSI: session 0x6943af8 to iqn.YYY-MM.com.array:sn.50412358 failed to connect, rc -5, I/O error
iSCSI: session 0x6943af8 connect failed at xxxx
Solution
The service console IP Address is setup for DHCP, which is supported for ESX .3.0.X
i.e.
#esxcfg-vswif -l Name Port Group IP Address Netmask Broadcast Enabled DHCP vswif0 Service Console 10.16.158.55 255.255.255.0 10.16.158.255 true true
or query the file
#less -S /etc/sysconfig/network-scripts/ifcfg-vswif0
DEVICE=vswif0
BOOTPROTO=dhcp
ONBOOT=yes
PORTGROUP=portgroup0
MACADDR=00:50:56:41:15:a4
the esx server is configured for S/W iSCSI
ie.
#esxcfg-vswitch -l Switch Name Num Ports Used Ports Configured Ports Uplinks vSwitch0 32 3 32 vmnic0 PortGroup Name Internal ID VLAN ID Used Ports Uplinks VM Network portgroup1 0 0 vmnic0 Service Console portgroup0 0 1 vmnic0 Switch Name Num Ports Used Ports Configured Ports Uplinks vSwitch1 64 2 64 vmnic1 PortGroup Name Internal ID VLAN ID Used Ports Uplinks VMkerneliSCSI portgroup2 0 1 vmnic1This is the static vmkernel IP address, i.e.
# esxcfg-vmknic -l Port Group IP Address Netmask Broadcast MAC Address MTU Enabled VMkernel 10.16.156.141 255.255.255.0 10.16.156.255 00:50:56:69:2f:04 1514 true=the default VMkernel route is set either via the VI client or via command line#esxcfg-route -a default 10.16.156.254#esxcfg-route VMkernel default gateway is 10.16.156.254The file /etc/sysconfig/network has not changed or appended to#cat /etc/sysconfig/network NETWORKING=yes GATEWAYDEV=vswif0 HOSTNAME=myhost.localdomainReboot the ESX serverWhen checking the default g/w again, it will be blank#esxcfg-route VMkernel default gateway is 0.0.0.0Trying to restore the g/w we get an error # esxcfg-route -r Error: Unable to get COS default routeWorkaround:Set the vmkernel default gatway manually on /etc/sysconfig/network fileLogin to your ESX console use an editor such as vi or "nano"add the entry GATEWAY=XXX.XXX.XXX.XXXi.e. cat /etc/sysconfig/networkNETWORKING=yes GATEWAYDEV=vswif0 HOSTNAME=vchost2.localdomain GATEWAY=10.16.156.254Now after a reboot the vmkernel g/w is retainedThere is a bug opened with relation to this issue, which is scheduled to be fixed on esx 3.0.3Based on VMware KB 1002729