VMware Cloud Community
cliffcahill
Enthusiast
Enthusiast

Enabling - Editing System TCP/IP NetStack - vMotion

I'm looking to enable the vMotion TCP/IP Stack prior to migrating the VMK to use the Stack. Setting DNS Values, Domain Name and default gateway to allow for L3 capabilities

I ma hoping to compete this using using ESXCLI commands on the newly provisioned host that will read the command via a KS script as there are no CMDlets in PowerCli available as of yet.

It seems pretty straight forward to create the fresh new stack and then add the VMK using this method.

esxcli network ip netstack add --netstack new-vmotion

esxcli network ip dns search  add  --netstack new-vmotion --domain test.domain

esxcli network ip dns server  add  --netstack new-vmotion --server 192.168.5.5

esxcli network ip dns server  add  --netstack new-vmotion --server 192.168.5.6

esxcli network vswitch standard portgroup add --portgroup-name Vmotion_ESX --vswitch-name vSwitch0

esxcli network vswitch standard portgroup set --portgroup-name Vmotion_ESX --vlan-id 202

esxcli network ip interface add --interface-name vmk10 --portgroup-name Vmotion_ESX --netstack new-vmotion

esxcli network ip interface ipv4 set --interface-name vmk10 --ipv4 192.168.111.100 --netmask 255.255.255.0 --type static

esxcli network ip route ipv4 add --network 192.168.111.0/24 --netstack new-vmotion --gateway 192.168.111.1

But if i want to use the existing stacks (vMotion, Provisioning ) that are automatically created during install they don't seem to listed. With the exception of the defaultTcpipStack as per below.

esxcli network ip netstack list

defaultTcpipStack

Key: defaultTcpipStack

Name: defaultTcpipStack

State: 4660

I manually created the VMK and Migrated to the system stack using the web client. Once i Did i re-ran the  esxcli network ip netstack list command  and both default and the vmotion netstack were listed

defaultTcpipStack

  Key: defaultTcpipStack

  Name: defaultTcpipStack

  State: 4660

vmotion

  Key: vmotion

  Name: vmotion

  State: 4660


I tried using the "vmotion" Key/Name list from the above command to edit the dns setting etc but to no luck there either.

One last thing i did try was to enable the Netstack as i noticed you could create them in disabled mode

esxcli network ip netstack set --netstack vmotion --enable true

Unable to find a Netstack instance vmotion


Any ideas if it is possible to edit the system TCP/IP NetStacks via the esxcli prior to adding the Vmks ? Once the VMk has been migrated it is possible to edit the DNS setting etc via esxcli


Any help or pointers appreciated



2 Replies
MikeStanton
Contributor
Contributor

Found your question and had the same exact problem. 

I was kind of upset to see you asked this 2 years ago and got no replies.

I figure you're well past this, but thought I'd post the solution for anyone else that is looking at this problem.

I'm using ESX 6.5 and PowerCLI, so I'm not sure if it works for older versions, but I suspect it does.

If you want to tap into vmWare's default net stacks, you have to name your custom stacks exactly as follows, case sensitive.

vMotion = vmotion

Provisioning = vSphereProvisioning

For those who could use some demo code, because I've literally spent 2 days slogging through poorly documented commands:

$vmhost = "EsxServer01"

$vsw = Get-vmHost $vmhost | Get-VirtualSwitch -standard

$portgroup1 = New-VirtualPortGroup -Name "vMotion" -VirtualSwitch $vsw -VLanID 100 -Confirm:$false

$portgroup2 = New-VirtualPortGroup -Name "vMigration" -VirtualSwitch $vsw -VLanID 101 -Confirm:$false

$vmk1 =  "vmk1"

$vmk2 = "vmk2"

$esxcli = Get-Esxcli -VMHost $vmhost

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

$esxcli.network.ip.interface.add($null,$null,$vmk1,$null,9000,"vmotion",$portgroup1.Name)

$esxcli.network.ip.netstack.add($null,"vSphereProvisioning")

$esxcli.network.ip.interface.add($null,$null,$vmk2,$null,9000,"vSphereProvisioning",$portgroup2.Name)

Hope that helps someone.  And if you're looking to use a distributed switch, good luck!

cliffcahill
Enthusiast
Enthusiast

vMotion TCP/IP Stack- Created by Powercli

Thanks for the reply Mike - See attached thread I got there in the END yay !:P

0 Kudos