Hi,
i got the power cli 5.5 that includes all the VDS traffic shaping policy commands.
i need to read a csv file that include the portgroup name , Width , Peak , Burst
and change the policy for all the portgroups in the list.
thanks,
Itay
Try something like this
Import-Csv dvConfig.csv -UseCulture | %{
Get-VDSwitch $_.dvSw | Get-VDPortgroup $_.dvPg |
Get-VDTrafficShapingPolicy -Direction In |
Set-VDTrafficShapingPolicy -Enabled $true -AverageBandwidth $_.InAverageBandWidth `
-PeakBandwidth $_.InPeakBandWidth -BurstSize $_.InBurstSize
Get-VDSwitch $_.dvSw | Get-VDPortgroup $_.dvPg |
Get-VDTrafficShapingPolicy -Direction Out |
Set-VDTrafficShapingPolicy -Enabled $true -AverageBandwidth $_.OutAverageBandWidth `
-PeakBandwidth $_.OutPeakBandWidth -BurstSize $_.OutBurstSize
}
The CSV should look like this
dvSw,dvPg,InAverageBandWidth,InPeakBandWidth,InBurstSize,OutAverageBandWidth,OutPeakBandWidth,OutBurstSize
sw1,pg1,50000,100000,150000,50000,100000,150000
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Try something like this
Import-Csv dvConfig.csv -UseCulture | %{
Get-VDSwitch $_.dvSw | Get-VDPortgroup $_.dvPg |
Get-VDTrafficShapingPolicy -Direction In |
Set-VDTrafficShapingPolicy -Enabled $true -AverageBandwidth $_.InAverageBandWidth `
-PeakBandwidth $_.InPeakBandWidth -BurstSize $_.InBurstSize
Get-VDSwitch $_.dvSw | Get-VDPortgroup $_.dvPg |
Get-VDTrafficShapingPolicy -Direction Out |
Set-VDTrafficShapingPolicy -Enabled $true -AverageBandwidth $_.OutAverageBandWidth `
-PeakBandwidth $_.OutPeakBandWidth -BurstSize $_.OutBurstSize
}
The CSV should look like this
dvSw,dvPg,InAverageBandWidth,InPeakBandWidth,InBurstSize,OutAverageBandWidth,OutPeakBandWidth,OutBurstSize
sw1,pg1,50000,100000,150000,50000,100000,150000
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference