Hi All,
I was able to create a vmk and enable vSphereReplication but I'm unable to enable vSphereReplicationNFC
New-VMHostNetworkAdapter -VMHost $esxiserver -PortGroup $NfcPG.Name -VirtualSwitch $dvSwitch -IP $IpAddress -SubnetMask $SubnetMask
$vnicMgr = Get-View -Id $esxiserver.ExtensionData.ConfigManager.VirtualNicManager
$vnicMgr.SelectVnicForNicType('vSphereReplicationNFC',$vmk6.Name)
Exception calling "SelectVnicForNicType" with "2" argument(s): "A specified parameter was not correct: "
At line:3 char:9
+ $vnicMgr.SelectVnicForNicType('vSphereReplicationNFC',$vmk6.N ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : VimException
I can select/deselect any of my vmk for that type of traffic.
Are you sure that $vmk6.Name contains 'vmk6'?
I can only reproduce that error when I provide an incorrect name for the VMKernel adapter.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Did you check that vmk6 is a candidate for that functionality?
$vnicMgr.Info.NetConfig | where{$_.NicType -eq 'vSphereReplicationNFC'} |
select -ExpandProperty CandidateVnic
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hi Luc,
i can confirm its vmk6 but what do you mean candidate? I’m away from my desk but will run that command later.
What at I can say is I was able to ename it via the GUI ok.
Under Info.Netconfig, the possible candidates for each type are listed (and the ones selected).
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hi Luc,
I've ran the command, i have 7 vmk's and they all seem to be candidates, i'm trying to set it on vmk6
Device : vmk0
Key : vSphereReplicationNFC.key-vim.host.VirtualNic-vmk0
Portgroup :
Spec : VMware.Vim.HostVirtualNicSpec
Port :
Device : vmk3
Key : vSphereReplicationNFC.key-vim.host.VirtualNic-vmk3
Portgroup :
Spec : VMware.Vim.HostVirtualNicSpec
Port :
Device : vmk4
Key : vSphereReplicationNFC.key-vim.host.VirtualNic-vmk4
Portgroup :
Spec : VMware.Vim.HostVirtualNicSpec
Port :
Device : vmk5
Key : vSphereReplicationNFC.key-vim.host.VirtualNic-vmk5
Portgroup :
Spec : VMware.Vim.HostVirtualNicSpec
Port :
Device : vmk6
Key : vSphereReplicationNFC.key-vim.host.VirtualNic-vmk6
Portgroup :
Spec : VMware.Vim.HostVirtualNicSpec
Port :
Device : vmk1
Key : vSphereReplicationNFC.key-vim.host.VirtualNic-vmk1
Portgroup :
Spec : VMware.Vim.HostVirtualNicSpec
Port :
Device : vmk2
Key : vSphereReplicationNFC.key-vim.host.VirtualNic-vmk2
Portgroup :
Spec : VMware.Vim.HostVirtualNicSpec
Port :
I can select/deselect any of my vmk for that type of traffic.
Are you sure that $vmk6.Name contains 'vmk6'?
I can only reproduce that error when I provide an incorrect name for the VMKernel adapter.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Luc, i figured the issue. i didn't set the variable $vmk6 for New-VMHostNetworkAdapter -VMHost $esxiserver -PortGroup $VrepPG.Name -VirtualSwitch $dvSwitch
I had it set to $Result = New-VMHostNetworkAdapter -VMHost $esxiserver -PortGroup $VrepPG.Name -VirtualSwitch $dvSwitch
Instead of $vmk6 = New-VMHostNetworkAdapter -VMHost $esxiserver -PortGroup $VrepPG.Name -VirtualSwitch $dvSwitch
Worked perfectly! Thanks again for your help Luc.