Wednesday, February 13, 2008

ESX trunking Server Side

In continuation of my last post:VMware ESX VLAN trunking I had a issue on one of the server where service console was not on a separate NIC and hence after trunking I couldn't get to it remotely via Virtual Center or ssh.
So basically, I had to use command line utilities on local console to get the service console back on network before I could create port groups for different vlans and attach my virtual servers to these. Here is how I went about doing this:
Login to ESX server as root and issue the following command:
esxcfg-vswitch -l
This command is mostly under /usr/sbin and Gives me list of currently configured port groups, their Now lets assume that service console port is under vlan 25 for vswitch0, so we would need to create a port group for that vlan and lets call it "SCVlan25", could be anything you want to call it.
So to create this new port group, issue the following commands:
Add the new port group:
esxcfg-vswitch --add-pg=SCVlan25 vSwitch0
Add it to required vlan:
esxcfg-vswitch --pg=SCVlan25 --vlan=25 vSwitch0
Now, esxcfg-vswitch -l
This would show you the added port group.

Next step is to add the service console port under this newly created port group.
Use the following command to get the listing:
esxcfg-vswif -l
Now, you would get the name of the interface from
this command, in my case it was vswif0.
Following command would be issued to put it in the right port-group:
esxcfg-vswif vswif0 -p SCVlan25
then again, "esxcfg-vswif -l" to confirm it.

Now your service console should be on the network. And you should be able to create other port groups using command line above or the Virtual Center as mentioned in the earlier post.

Another issue I ran into is that after deleting a virtual switch so that I can team the physical NICs, the other virtual switch would not show the physical NIC I wanted to add, in virtual center.
So this had to be done via command line also:
esxcfg-vswitch -L vmnic# vSwitch#
where vmnic# would be replaced by whatever NIC you want to add to that particular vswitch#.

No comments: