Hi all,
As I was creating vmk’s i found that I could enable vsan traffic, vmotion and management traffic but nothing there for vSphere replication and NFC, any ideas on how I might be able to do this with powercli?
Try something like this
$esxName = 'MyEsx'
$vssName = 'MyVSS'
$pgName = 'MyPG'
$ipAddr = '192.168.1.1'
$ipMask = '255.255.255.0'
$esx = Get-VMHost -Name $esxName
$vmk = New-VMHostNetworkAdapter -VMHost $esx -PortGroup $pgName -IP $ipAddr -SubnetMask $ipMask -VirtualSwitch $vssName
$vnicMgr = Get-View -Id $esx.ExtensionData.ConfigManager.VirtualNicManager
$vnicMgr.SelectVnicForNicType('vSphereReplication',$vmk.Name)
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Try something like this
$esxName = 'MyEsx'
$vssName = 'MyVSS'
$pgName = 'MyPG'
$ipAddr = '192.168.1.1'
$ipMask = '255.255.255.0'
$esx = Get-VMHost -Name $esxName
$vmk = New-VMHostNetworkAdapter -VMHost $esx -PortGroup $pgName -IP $ipAddr -SubnetMask $ipMask -VirtualSwitch $vssName
$vnicMgr = Get-View -Id $esx.ExtensionData.ConfigManager.VirtualNicManager
$vnicMgr.SelectVnicForNicType('vSphereReplication',$vmk.Name)
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks Luc,
million dolllar question.. can we do this on a DVS?
Yes, use the name of a VDS switch where there is $vssName, and use a portgroup on that VDS switch.
Code stays the same
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Dear LucD
I want to setup Replication and NFC together on the same vmk.
Thank you.
Provided MultiSelectAllowed is $true (which is the default), you just need to another call.
Like this
$esxName = 'MyEsx'
$vssName = 'MyVSS'
$pgName = 'MyPG'
$ipAddr = '192.168.1.1'
$ipMask = '255.255.255.0'
$esx = Get-VMHost -Name $esxName
$vmk = New-VMHostNetworkAdapter -VMHost $esx -PortGroup $pgName -IP $ipAddr -SubnetMask $ipMask -VirtualSwitch $vssName
$vnicMgr = Get-View -Id $esx.ExtensionData.ConfigManager.VirtualNicManager
$vnicMgr.SelectVnicForNicType('vSphereReplication',$vmk.Name)
$vnicMgr.SelectVnicForNicType('vSphereReplicationNFC',$vmk.Name)
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference