Monday, February 11, 2008

VMware ESX VLAN trunking

We had been running VMWare ESX servers for a while without any VLAN trunking. This means, each physical NIC was part of a separate VLAN and this led to no network teaming(hence no failover) as number of NICs were be limited.
Another limitation was that we couldn't add any more VLANs as all the NICs were already used. This is when we decided its better use trunking in our environment. I got my start from following website for Cisco IOS configs:
ESX Server, NIC Teaming, and VLAN Trunking
This worked fine for the server on switches running Cisco IOS.
But since we are running some switches in hybrid config with CatOS, the following steps were taken on those switches for ESX server to work in trunking mode:

1. If you haven't created a native VLAN for ESX environment now, you would need to create that with following command:
set vlan "vlan-id" name "name"
"vlan-id" here is the vlan number you want to assign this new vlan and could be anything between normal range 1–1000 and extended range 1025–4096.
name doesn't have to specified but makes it easy to see what vlan is what.

2. Change the port to trunking mode:
set trunk "mod/port" on dot1q
or
set trunk "mod/port" on dot1q "vlan numbers"
depending on whether you want to allow all VLANs or certain VLANs on the port.

3. Set the native vlan on the port:
By default vlan 1 is the native vlan, to change it:
set vlan "vlan-id" "mod/port"
where "vlan-id" is the vlan number created in step 1 or the vlan number if it already exists in your network.

Now, on the ESX server side:
From the virtual center, go to configuration for the host and click on networking.
Then Add Networking, Choose Virtual Machine, choose the vswitch with the NIC(s), choose the name you want to call it and "vlan-id" for that port group.
You can repeat the same steps for whatever vlans you want to configure on the host.
After that you can Edit the settings for the Virtual Machine to point to their respective port-groups and should be good to go.

No comments: