VMware Cloud Community
OsburnM
Hot Shot
Hot Shot
Jump to solution

Using PowerCLI To Configure vDS NetFlow Collector IP

Anyone know if possible to set the NetFlow collector IP/settings on a vDS with PowerCLI?  Running through the Get-vDSWitch stuff, I can see how to query erspans already configured but I don't see a place where I can set the Collector IP & related settings.

Thanks for the help in advance!

1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

As an example

$vdsName = 'MyVDS'

$vds = Get-VDSwitch -Name $vdsName


$spec = New-Object VMware.Vim.VMwareDVSConfigSpec

$spec.IpfixConfig = New-Object VMware.Vim.VMwareIpfixConfig

$spec.IpfixConfig.CollectorIpAddress = '192.168.1.1'

$spec.IpfixConfig.CollectorPort = 7777

$spec.IpfixConfig.ActiveFlowTimeout = 60

$spec.IpfixConfig.IdleFlowTimeout = 15

$spec.IpfixConfig.InternalFlowsOnly = $false

$spec.IpfixConfig.SamplingRate = 100


$spec.ConfigVersion = $vds.ExtensionData.Config.ConfigVersion


$vds.ExtensionData.ReconfigureDvs($spec)


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

View solution in original post

2 Replies
LucD
Leadership
Leadership
Jump to solution

Not with the cmdlets, you'll have to revert to the API methods


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

LucD
Leadership
Leadership
Jump to solution

As an example

$vdsName = 'MyVDS'

$vds = Get-VDSwitch -Name $vdsName


$spec = New-Object VMware.Vim.VMwareDVSConfigSpec

$spec.IpfixConfig = New-Object VMware.Vim.VMwareIpfixConfig

$spec.IpfixConfig.CollectorIpAddress = '192.168.1.1'

$spec.IpfixConfig.CollectorPort = 7777

$spec.IpfixConfig.ActiveFlowTimeout = 60

$spec.IpfixConfig.IdleFlowTimeout = 15

$spec.IpfixConfig.InternalFlowsOnly = $false

$spec.IpfixConfig.SamplingRate = 100


$spec.ConfigVersion = $vds.ExtensionData.Config.ConfigVersion


$vds.ExtensionData.ReconfigureDvs($spec)


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