Showing posts with label esx. Show all posts
Showing posts with label esx. Show all posts

Wednesday, June 18, 2008

ESX: Service Console and default route being lost!

This may seem very trivial.. and indeed it is, the saying "maybe a set of fresh eyes will help" is quite possibly a required procedure rather than a question... geek ego's may get in the way though. :p

Too many late nights and a never ending list of tasks to complete with ever shortening deadlines. This is what lead me to discover some interesting behaviour in ESX and quite possibly apparent in Linux/Unix distro's too..?

To configure a default route in an ESX Service Console (or on a RHEL based distro) is to add the gateway into the /etc/sysconfig/network file. GATEWAY=10.0.0.1

You can then run the command route which should give you an output with something similar to this:
default 10.0.0.1 0.0.0.0 UG 0 0 0 eth0

What I had, no gateway was being set, even though my network file was correctly configured. Manually running the route command was a temporary fix, though it was lost once a reboot or network service restart command was executed:
route add default gw 10.0.0.1
As it turned out, the route was being dropped because of a configuration mis-match in my interfaces file. In the case of my ESX server, the interface file: /etc/sysconfig/network-scripts/ifcfg-vswif0

The culprit was the line: NETWORK=192.168.0.0 when in fact it should of been configured as NETWORK=10.0.0.0

Thus the end to my default route not being set by the configuration of /etc/sysconfig/network

Monday, June 16, 2008

ESX Networking from the CLI

11:30 PM Sunday night, tired and still trying to finish off a few tidy up jobs, in preparation for Dell / EMC engineer tomorrow (doing SAN install).

So there I am, trying to add a new port group for a management VLAN I'd created earlier on the pSwitches. However, instead of creating a port group I created a vSwitch, then tried to bind a pNic to it, which was already attached to another vSwitch.

Logic states that ESX shouldn't let me do that... but.... something weird happened.. POOF! The ESX server dropped off the face of the earth. No VM's attached to vSwitch0 had comms! I tested pinging a VM on another vSwitch, worked fine.. I also didn't have a service console on that vSwitch either.. My users based in United States would be waking up soon, so I decided to drive out to the data centre and troubleshoot it. :(

Since I couldn't rely on a nice GUI to manage ESX, I soon realised my ESX CLI knowledge is somewhat lacking! After a quick search I found this site, which saved my bacon:

http://www.petri.co.il/5-critical-vmware-esx-cli-network-commands.htm


This showed me that I had no pNics linked to vSwitch0
esxcfg-vswitch -l

This added the pNic onto vSwitch0 and thus got my service console back on the network. :)
esxcfg-vswitch -L vmnic0 vSwitch0