Friday, June 25, 2010

How to recreate Service Console networking from cli

Verify if exists the vswif adapter with esxcfg-vswif –l command

If exists delete the vswif adapter run esxcfg-vswif -d vswif0

View list name of the vSwitch with esxcfg-vSwitch –l command

If exists delete the vSwitch run esxcfg-vSwitch -d vSwitch0

Create a new vSwitch running esxcfg-vswitch -a vSwitch0

Create default port groups for vSwitch eith commands
esxcfg-vswitch -A "VM Network" vSwitch0
esxcfg-vswitch -A "Service Console" vSwitch0

Create vswif adapter with
esxcfg-vswif --add --portgroup "Service Console" --ip=<hoist_ip> --netmask=<netmask> vswif0

If you need to change the vlan ID run
esxcfg-vswitch -p "VM Network" -v <vlan id> vSwitch0

Run the following commands to list all network adapters. associate a vmnic and vmnic associated to vSwitch
esxcfg-nics -l
esxcfg-vswitch -L vmnic1 vSwitch0
esxcfg-vswitch -l

Run cat /etc/sysconfig/network to verify if contain correct settings

Restart network services with service network restart