echo '####### Delete existing Mgmt nic and vswitch '
/sbin/esxcli network ip interface remove -i vmk0
/sbin/esxcli network vswitch standard portgroup remove -p "Management Network" -v vSwitch0
/sbin/esxcli network vswitch standard remove -v vSwitch0
echo '####### Define virtual switches '
/sbin/esxcli network vswitch standard add -v DREN
/sbin/esxcli network vswitch standard uplink add -v DREN -u vmnic0
/sbin/esxcli network vswitch standard uplink add -v DREN -u vmnic1
/sbin/esxcli network vswitch standard portgroup add -p B412_WinServer -v DREN
/sbin/esxcli network vswitch standard portgroup add -p B1004_WinServer -v DREN
/sbin/esxcli network vswitch standard portgroup add -p WDS_Imaging -v DREN
/sbin/esxcli network vswitch standard portgroup add -p B412_LinServer -v DREN
/sbin/esxcli network vswitch standard portgroup add -p B412_VirtUsers -v DREN
/sbin/esxcli network vswitch standard portgroup add -p Mgmt -v DREN
echo '####### Define Mgmt nic '
/sbin/esxcli network ip interface add -i vmk0 -p Mgmt
/sbin/esxcli network ip interface ipv4 set -i vmk0 -I 192.168.1.1 -N 255.255.255.0 -t static
/sbin/esxcli network ip route ipv4 add -n default -g 192.168.1.254
/sbin/esxcli network ip interface tag add -i vmk0 -t VMotion
/sbin/esxcli network ip interface tag add -i vmk0 -t faultToleranceLogging
/sbin/esxcli network ip interface tag add -i vmk0 -t vSphereReplication
/sbin/esxcli network ip interface tag add -i vmk0 -t vSphereReplicationNFC
/sbin/esxcli network ip interface tag add -i vmk0 -t vSphereProvisioning
esxcli network vswitch standard policy failover set -a vmnic0,vmnic1 -v DREN
esxcli network vswitch standard portgroup policy failover set -a vmnic0,vmnic1 -p Mgmt
esxcli network vswitch standard policy failover set -l iphash -v DREN
esxcli network vswitch standard portgroup policy failover set -l iphash -p Mgmt