Labels

Sunday, June 26, 2011

To Create PortGroups for VLAN Networking NIC Team


  •  We have to create a switch, a portgroup for each VLAN, allocate our NIC’s and then set the VLAN ID
             esxcfg-vswitch –a vSwitch2
             esxcfg-vswitch –A accounts vSwitch2
             esxcfg-vswitch –A rnd vSwitch2
             esxcfg-vswitch –A sales vSwitch2
             esxcfg-vswitch –L vmnic1 vSwitch2
             esxcfg-vswitch –L vmnic2 vSwitch2
  •         The next part is to set the VLAN id for each network (account, rnd and sales)

    esxcfg-vswitch –v 10 –p accounts vSwitch2
    esxcfg-vswitch –v 20 –p rnd vSwitch2
    esxcfg-vswitch –v 30 –p sales vSwitch2

    If you run the command esxcfg-vswitch –l  we will see this information
      
    If you wish to see this reflected in the VI Client then type:
    service mgmt-vmware restart
    Note: This is how my switch configuration looks now


To Create a vSwitch


  • To create a new switch type: 
                        esxcfg-vswitch –a vSwitch
  • Then add a portgroup
                         esxcfg-vswitch –A internal vSwitch1
                         Note: Lower-case -a for adding a switch, and upper-case -A for adding a portgroup 
  •  If you run the command esxcfg-vswitch –l you will see this information
 
  •   If you wish to see this reflected in the VI Client then type: 
                          service mgmt-vmware restart
                          Note: This is how my switch configuration looks now


 
Creating a vSwitch (Single NIC)
  • In this case we will create a new switch and then the port group like so:
                  esxcfg-vswitch –a vSwitch2
                  esxcfg –A production
  • Next patch a NIC to the vSwitch with
                esxcfg-vswitch -L vmnic1 vSwitch2
  • Note: this is a case-sensitive option. –l lists switches, whereas –L links nic’s to switches
  • If you run the command esxcfg-vswitch –l you will see this information

  • If you wish to see this reflected in the VI Client then type: 
    service mgmt-vmware restart 
    Note: This is how my switch configuration looks now
Creating a vSwitch ( Multiple NIC's)
  •  esxcfg-vswitch -L vmnic2 vSwtch1 
                 If you run the command esxcfg-vswitch –l you will see  information
  • If you wish to see this reflected in the VI Client then type:
                   service mgmt-vmware restart
                  Note: This is how my switch configuration looks now

Deleting a Switch from vSwitch
Note: I am delete my vSwitch2 to free up my NIC’s…
          esxcfg-vswitch –d vswitch2