Pages

Friday, September 20, 2013

Neat trick for reaching an ESXi host when vmk0 is misconfigured

Last night while reconfiguring my network after my new layer 3 switch, I had to change the IP address of vmk0 on my ESXi host.   I had to change the IP, default gateway, and VLAN all in one go.  Apparently that doesn't actually worked, after making the changes and hitting Save, I could not ping the host with it's new IP address.  I have no local monitor on the host, and for some reason the IPMI console isn't working (that is a later troubleshooting step).

I'm pretty sure I know what's wrong, but how can I get in to the host to find out.  I do have ssh enabled, but of course can't reach vmk0.  So my next thought is how can I reach vmk1 (the iSCSI interface).  When you enable ssh, it's enabled on all interfaces, not just the management interface.  I didn't have any VMs on the storage subnet, but it turns out I can ssh in to my Synology Diskstation.  From there, I was able to ssh in to the iSCSI interface on the ESXi host.  Sure enough, the VLAN change and the default gateway didn't get updated, just the IP address.  After a quick change from the command line I was up and running:
# esxcfg-vswitch -v 30 -p "Management Network" vSwitch0
# esxcfg-route 10.10.30.1
I've used that trick before when I was working as an Escalation Engineer for VMware.  It's a very hand trick and saves a lot of time by not having to hook up a console (or in one customers case, driving 30 miles to the datacenter).  Of course, remote consoles are the better answer, as this trick only works if ssh is already enabled.

No comments:

Post a Comment