VMware Cloud Community
FredericSOSSON
Contributor
Contributor

VMkernel creation with TCP/IP stack

Hello,

I am trying to create VMkernels with TCP/IP stack 'vmotion' but I do not see anywhere it is feasible.

Does anybody know?

Thanks

Fred

0 Kudos
10 Replies
daphnissov
Immortal
Immortal

Where are you trying to do this? It is most certainly feasible in the vSphere Web Client as well as the ESXi embedded host client for 6.5.

0 Kudos
FredericSOSSON
Contributor
Contributor

I am trying to do this from PowerCLI, my env. is vSphere 6.0

0 Kudos
IT_pilot
Expert
Expert

You need to сonnect to the host via SSH.

How to Configure Multiple TCP/IP Stacks in vSphere 6 -- Virtualization Review

http://it-pilot.ru
0 Kudos
LucD
Leadership
Leadership

You can do this with PowerCLI, but only for VSS, not VDS.

See Re: Create VMK with vmotion TCP Stack

And you don't need to use SSH for this (would look silly in a PowerCLI community me thinks)


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
IT_pilot
Expert
Expert

oh yeah, did not notice that the issue was published in VMware PowerCLI

http://it-pilot.ru
0 Kudos
FredericSOSSON
Contributor
Contributor

thank you guys

thank you LucD

sorry for the delay Smiley Wink

0 Kudos
LucD
Leadership
Leadership

So I gather that script worked for you?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
FredericSOSSON
Contributor
Contributor

Hi LucD,

Thanks a lot for helping, much appreciated Smiley Wink

That script only works with VSS and I need a solution that works with VDS.  My goal is to automate the creation of VMkernel mapped to VMotion TCP/IP stack (because I need a specific gateway) like this :

tcpipstackissue-04[1].jpg

Do you see a way to do it?

Regards,

FRed

0 Kudos
LucD
Leadership
Leadership

Took me some trial and error, but the following seems to work (for me in vSphere 6.5).

$esxName = 'MyEsx'

$switchName = 'MyVDS'

$portgroupName = 'MyVDSPortgroup'

$ipAddr = '192.168.1.1'

$ipMask = '255.255.255.0'

$esx = Get-VMHost -Name $esxName

$vds = Get-VirtualSwitch -Name $switchName -VMHost $esx -Distributed

$pg = Get-VirtualPortGroup -Name $portgroupName -VirtualSwitch $vds

$netSys = Get-View -Id $esx.ExtensionData.ConfigManager.NetworkSystem

$nic = New-Object VMware.Vim.HostVirtualNicSpec

$port = New-Object VMware.Vim.DistributedVirtualSwitchPortConnection

$port.SwitchUuid = $vds.Key

$port.PortgroupKey = $pg.Key

$nic.DistributedVirtualPort = $port

$ip = New-Object VMware.Vim.HostIpConfig

$ip.IpAddress = $ipAddr

$ip.SubnetMask = $ipMask

$nic.Ip = $ip

$nic.NetStackInstanceKey = [VMware.Vim.HostNetStackInstanceSystemStackKey]::vmotion

$netSys.AddVirtualNic('',$nic)


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
FredericSOSSON
Contributor
Contributor

LucD you rock! Smiley Wink

That script works like a charm!

Thanks a million

Fred

0 Kudos