VMware Cloud Community
Stu_McHugh
Hot Shot
Hot Shot
Jump to solution

Trying to set the 'LoadBalancingPolicy' and failing

I'm trying to set the load balencing policy but just starting with the 'Get' first.  the commmand line I'm trying to use is:

Get-VMHost -Name Serv1.withers.net | Get-VirtualSwitch -name vSwitch1 | Get-NicTeamingPolicy -loadbalancingpolicy

I get the following error message:

Get-NicTeamingPolicy : A parameter cannot be found that matches parameter name 'loadbalancingpolicy'.

Any idea's?

Stuart ------------------------------------------------ Please award points to any useful answers..
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

You will first have to 'get' the teaming policy.

Like this

Get-VMHost -Name Serv1 | Get-VirtualSwitch -name vSwitch1 | 
Get-NicTeamingPolicy | Set-NicTeamingPolicy -LoadBalancingPolicy LoadBalanceIP


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

View solution in original post

0 Kudos
10 Replies
LucD
Leadership
Leadership
Jump to solution

That should be

Get-VMHost -Name Serv1.withers.net | Get-VirtualSwitch -name vSwitch1 | 
Get-NicTeamingPolicy
| Select LoadBalancingPolicy

In the Get-NicTeamingPolicy cmdlet there is no parameter called LoadBalancingPolicy. But the LoadBalancingPolicy is a property in the returned object.


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

0 Kudos
Stu_McHugh
Hot Shot
Hot Shot
Jump to solution

Hi Luc,

After the 'Select' I don't have the option of  'LoadBalancingPolicy'

I have a list such as, Debug, error action, errorvariable, etc.

Stuart ------------------------------------------------ Please award points to any useful answers..
0 Kudos
Stu_McHugh
Hot Shot
Hot Shot
Jump to solution

Oh! Hang on!  PowerGUI is lieing to me!

Stuart ------------------------------------------------ Please award points to any useful answers..
0 Kudos
LucD
Leadership
Leadership
Jump to solution

The Select, which is short for Select-Object, allows you to pick the properties from the object that you want to display.

Fully written that should be

Get-VMHost -Name Serv1.withers.net | Get-VirtualSwitch -name vSwitch1 | 
Get-NicTeamingPolicy | 
Select-Object -Property LoadBalancingPolicy


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

Stu_McHugh
Hot Shot
Hot Shot
Jump to solution

OK......

So to set it, what I'm I doing wrong with this?

Get-VMHost -Name Serv1 | Get-VirtualSwitch -name vSwitch1 | Set-NicTeamingPolicy -LoadBalancingPolicy LoadBalanceIP

Stuart ------------------------------------------------ Please award points to any useful answers..
0 Kudos
LucD
Leadership
Leadership
Jump to solution

You will first have to 'get' the teaming policy.

Like this

Get-VMHost -Name Serv1 | Get-VirtualSwitch -name vSwitch1 | 
Get-NicTeamingPolicy | Set-NicTeamingPolicy -LoadBalancingPolicy LoadBalanceIP


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

0 Kudos
Stu_McHugh
Hot Shot
Hot Shot
Jump to solution

Excellent! Thanks Luc!

Stuart ------------------------------------------------ Please award points to any useful answers..
0 Kudos
svisen
Enthusiast
Enthusiast
Jump to solution

Hi Stu ,

i have an similar scenario,

one esxi server  running 3 identical os and having identical configuration,i want to test and implement Load balencing in such a way that,

want to bind all of the 3 vm , in case my one or 2 vm gets down  ihave the 3rd vm to process the request.

can you please guide me with this as i am new to load balencing stuff.

--

Thanks

Svisen

0 Kudos
LucD
Leadership
Leadership
Jump to solution

Hi Svisen, I'm not sure I get the question.

Are you talking about teamed NICs on a switch ?


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

0 Kudos
svisen
Enthusiast
Enthusiast
Jump to solution

Hi Lucd,

I want an test environment to be created with 3 vm of windows running on one server hosting esxi 5.0.

I have an application installed on all the 3 vm , each identical with application or simply an clone rather, and i have an application deployed on the virtual machine

now as  i want that all the 3 vm should share an common IP ,so that when ever one or two server goes down the request should be processed by the 3rd server.

I dont was to use apache load balencing or OS clustering , i want to configure  load balencing using ESXI features, to which i am unawre to how to do it .please guide am new to the clustering.

--thanks

0 Kudos