Hello all
I'm trying to automate the activation of services "vSphere replicaton traffic" and "vSphere Replication NFC traffic" on a vmkernel port and I can't find anywhere the option to do it in Powercli.
I have search Powercli documentation and looked everywhere I could, without success...
No option seems available through New-VMHostNetworkAdapter and Set-VMHostNetworkAdapter
Is there a way to activate those services through Powercli or is it not implemented (yet)?
I have about 40 Esxi to reconfigure and doing it manually through the Web Client is "not efficient"
Thanks
Sebastien
Try like this, it works for VSS and VDS
$esxName = 'MyEsx'
$vmkName = 'vmk0'
$esx = Get-VMHost -Name $esxName
$vnicMgr = Get-View -Id $esx.ExtensionData.ConfigManager.VirtualNicManager
$vnicMgr.SelectVnicForNicType('vSphereReplication',$vmkName)
$vnicMgr.SelectVnicForNicType('vSphereReplicationNFC',$vmkName)
/body>
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Not through a PowerCLI cmdlet I'm afraid.
But you can call the API method from PowerCLI.
Is that a vmk on a VSS or a VDS?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thank you for your answer. (That's what I feared ^^)
Half or infra has this vmk on VSS, the other half on VDS.
Try like this, it works for VSS and VDS
$esxName = 'MyEsx'
$vmkName = 'vmk0'
$esx = Get-VMHost -Name $esxName
$vnicMgr = Get-View -Id $esx.ExtensionData.ConfigManager.VirtualNicManager
$vnicMgr.SelectVnicForNicType('vSphereReplication',$vmkName)
$vnicMgr.SelectVnicForNicType('vSphereReplicationNFC',$vmkName)
/body>
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thank you very much.
Working great
good script!!
but how can be done with binding to Network Label? not vmkname
The Network Label is the Portgroup, but what if there is more than 1 VMKernel on that Portgroup?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
in my case, only one vmkernel
You should be able to go from Network Label to the VMKernel.
Something like this
$vmkName = Get-VirtualPortGroup -Name $pgName |
Get-VMHostNetworkAdapter -VMKernel |
where{$_.VMHost.Name -eq <name of the ESXi node>} |
Select -ExpandProperty Name
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference