New-SCLoadBalancerVIP
Creates a load balancer VIP on a load balancer.
Syntax
New-SCLoadBalancerVIP
[-VMMServer <ServerConnection>]
-Name <String>
-LoadBalancer <LoadBalancer>
-IPAddress <String>
[-LoadBalancerPort <UInt16>]
[-LoadBalancerVIPTemplate <LoadBalancerVIPTemplate>]
[-IsPersistenceEnabled <Boolean>]
[-LoadBalancerConnectionPersistence <LoadBalancerConnectionPersistence>]
[-LoadBalancerHealthMonitor <LoadBalancerHealthMonitor[]>]
[-LoadBalancerProtocol <LoadBalancerProtocol>]
[-LoadBalancingMethod <LoadBalancingMethod>]
[-FrontEndVMNetwork <VMNetwork>]
[-BackEndVirtualNetworkAdapters <VirtualNetworkAdapter[]>]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[<CommonParameters>]
Description
The New-SCLoadBalancerVIP cmdlet creates a load balancer virtual IP (VIP) on a load balancer.
Examples
Example 1: Create a load balancer virtual IP
PS C:\> $LBProtocol = New-SCLoadBalancerProtocol -Name "HTTPS" -HTTPSCertificateSubjectName "C=US,ST=WA,L=Redmond,O=Contoso,OU=Test,CN=www.contoso.com/emailAddress=contoso@contoso.com" -HTTPSReencryptConnection $True -TerminateHTTPS $True
PS C:\> $LBConnectionPersistence = New-SCLoadBalancerConnectionPersistence -Name "SourceIP" -Value "255.255.255.0"
PS C:\> $LBHealthMonitor = New-SCLoadBalancerHealthMonitor -Name "HTTPMonitor" -Request "Get /Index.html HTTP/1.1" -Response 200 -IntervalSeconds 5 -TimeoutSeconds 2 -ProtocolName "HTTPS"
PS C:\> $LBMethod = New-SCLoadBalancingMethod -Name "LeastConnections"
PS C:\> $LoadBalancer = Get-SCLoadBalancer -LoadBalancerAddress "LB01.Contoso.com"
PS C:\> New-SCLoadBalancerVIP -Name "LoadBalancerVIP01" -IPAddress 10.0.0.1 -LoadBalancer $LoadBalancer -LoadBalancerConnectionPersistence $LBConnectionPersistence -LoadBalancerProtocol $LBProtocol -LoadBalancingMethod $LBMethod -LoadBalancerHealthMonitor $LBHealthMonitor -LoadBalancerPort 80
The first command creates a load balancer protocol object and stores the object in the $LBProtocol variable.
The second command creates a load balancer connection persistence object and stores the object in the $LBConnectionPersistence variable.
The third command creates a load balancer health monitor object and stores the object in the $LBHealthMonitor variable.
The fourth command creates a load balancing method object and stores the object in the $LBMethod variable.
The fifth command gets the load balancer object with the address LB01.Contoso.com and stores the object in the $LoadBalancer variable.
The last command creates a load balancer VIP named LoadBalancerVIP01 using the load balancer stored in $LoadBalancer and the objects created in the previous commands.
Parameters
-BackEndVirtualNetworkAdapters
Specifies the list of VirtualNetworkAdapter objects of the VMs that are load balanced.
Type: | VirtualNetworkAdapter[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-FrontEndVMNetwork
Specifies the virtual machine network for the front end IP of the load balancing rule. This is the network from which the load balancer VIP is taken.
Type: | VMNetwork |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-IPAddress
Specifies an IPv4 or IPv6 address.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-IsPersistenceEnabled
Indicates whether persistence is enabled for a load balancer VIP. When set to $True, the load balancer attempts to direct a particular client to the same virtual machine behind the load balancer.
Type: | Boolean |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-JobVariable
Specifies that job progress is tracked and stored in the variable named by this parameter.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-LoadBalancer
Specifies a load balancer object.
Type: | LoadBalancer |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-LoadBalancerConnectionPersistence
Specifies a load balancer connection persistence object.
Type: | LoadBalancerConnectionPersistence |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-LoadBalancerHealthMonitor
Specifies a load balancer health monitor object.
Type: | LoadBalancerHealthMonitor[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-LoadBalancerPort
Specifies the port to use when configuring a VIP in a load balancer.
Type: | UInt16 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-LoadBalancerProtocol
Specifies the protocol to use when connecting to a load balancer, or a load balancer protocol object.
Type: | LoadBalancerProtocol |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-LoadBalancerVIPTemplate
Specifies a load balancer VIP template.
Type: | LoadBalancerVIPTemplate |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-LoadBalancingMethod
Specifies the load balancing method to use. Valid values are:
- RoundRobin
- LeastConnectionsmember
- Observedmember
- Predictivemember
- Ratiomember
- Fastestmember
- LeastConnections
- Observednode
- Predictivenode
- Rationode
- FastestResponseTime
- LeastSessions
- None
To determine the available methods for a specific load balancer, use the following command: (Get-SCLoadBalancer)[0].AvailableLoadBalancingMethods
Type: | LoadBalancingMethod |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Name
Specifies the name of a Virtual Machine Manager (VMM) object.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-PROTipID
Specifies the ID of the Performance and Resource Optimization tip (PRO tip) that triggered this action. This parameter lets you audit PRO tips.
Type: | Guid |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-RunAsynchronously
Indicates that the job runs asynchronously so that control returns to the command shell immediately.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-VMMServer
Specifies a VMM server object.
Type: | ServerConnection |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Outputs
LoadBalancerVIP
This cmdlet returns a LoadBalancerVIP object.
Notes
- Requires a VMM load balancer object, which can be retrieved using the Get-SCLoadBalancer cmdlet.