inok
Contributor
Contributor

I also can not find parameters on PowerCli commandlets for host network config to support this new features, but I successfully did this task with get-esxcli:

$vmhost = Get-VMHost <hostname>

$esxcli= Get-EsxCli -VMHost $vmhost

#adding new portgroup for vmkernel traffic

$vmhost | Get-VirtualSwitch -Name "vSwitch0" | New-VirtualPortGroup "vmk_vmotion1" -VLanId <VLAN>

#adding new network stack

$esxcli.network.ip.netstack.add($false, "vmotion")

#adding new vmkernel interface to new stack

$esxcli.network.ip.interface.add($null, $null, "vmk1", $null, $null, "vmotion", "vmk_vmotion1")

#configuring vmk1 to use dhcp

$esxcli.network.ip.interface.ipv4.set("vmk1", $null, $null, $null, "dhcp")

Also you can archive same result using esxcli directly on the ESXi:

esxcli network ip netstack add -N vmotion

esxcli network vswitch standard portgroup add -p vmk_vmotion1 -v vSwitch0

esxcli network vswitch standard portgroup set -p vmk_vmotion1 -v <VLAN>

esxcli network ip interface add -i vmk1 -N vmotion -p vmk_vmotion1

esxcli network ip interface ipv4 set -i vmk1 -t dhcp

Reply
0 Kudos