If you want to manage private IP addresses for an internal-facing Classic Load Balancer (CLB) instance in a virtual private cloud (VPC), you can use OpenAPI Explorer to create an internal-facing CLB instance. When you create the instance, you can specify an IPv4 address as the private IP address of the CLB instance. The IPv4 address must fall within the CIDR block of the vSwitch to which the CLB instance belongs.
Usage notes
You can specify private IPv4 addresses only for internal-facing CLB instances in VPCs.
You cannot specify IP addresses for Internet-facing CLB instances.
You cannot specify IP addresses for CLB instances in the classic network.
Procedure
Log on to OpenAPI Explorer.
On the
CreateLoadBalancer
page, configure the request parameters. In this example, Region is set to China (Shanghai).The following table describes only the key parameters. For more information, see CreateLoadBalancer.
Parameter
Description
Example
RegionId
The region ID of the CLB instance.
You can call the DescribeRegions operation to query the most recent region list.
cn-shanghai
LoadBalancerName
The name of the CLB instance.
CLB-test01
VpcId
The ID of the VPC to which the CLB instance belongs.
You can log on to the VPC console. In the top navigation bar, select the China (Shanghai) region. On the VPC page, find and view the ID of the VPC that you want to manage.
vpc-bp18jb3fqfklxde2z****
VSwitchId
The ID of the vSwitch to which the CLB instance belongs.
If you want to deploy the CLB instance in a VPC, this parameter is required. If this parameter is specified, AddessType is set to intranet by default.
Log on to the VPC console. In the top navigation bar, select the China (Shanghai) region. On the VPC page, click the ID of the VPC that you want to manage. On the Resources tab, click the number of vSwitches to view the IDs and CIDR blocks of the vSwitches.
vsw-bp1gw3z8urk2a7n8j****
PayType
The billing method of the CLB instance. Valid values:
PayOnDemand: pay-as-you-go.
PrePay: subscription
NoteIf you set this parameter to PrePay, you must specify the Duration parameter.
PayOnDemand
InstanceChargeType
The metering method of the CLB instance. Valid values:
PayBySpec (default): pay-by-specification
PayByCLCU: pay-by-LCU
NoteThis parameter is supported only by instances created on the Alibaba Cloud China site and only if PayType is set to PayOnDemand.
PayByCLCU
Address
The private IP address of the CLB instance. The private IP address must be an idle IP address that is included in the destination CIDR block of the vSwitch.
172.16.20.189
Click Initiate Call.
The following result is returned. If the returned HTTP status code is 200, the CLB instance is created. If another HTTP status code is returned, refer to the returned message or Troubleshoot HTTP 5xx errors to troubleshoot the issue.
{ "LoadBalancerName": "CLB-test01", "VpcId": "vpc-uf6x6rm6tdj********", "RequestId": "60E9F897-6C4B-5E37-BBFA-***********", "ResourceGroupId": "rg-acfm2bz********", "Address": "172.16.20.189", "NetworkType": "vpc", "AddressIPVersion": "ipv4", "VSwitchId": "vsw-uf6ee831m3********", "LoadBalancerId": "lb-uf6p0mf********" }
After the call is successful, you can call the DescribeLoadBalancerAttribute operation to view the parameters of the CLB instance. You can find that the endpoint of the CLB instance is the specified private IP address.
Optional: After the call is successful, log on to the CLB console to view the parameters of the instance whose private IP address is
172.16.20.189
.In the top navigation bar, select the China (Shanghai) region.
On the Instances page, find the instance and click its ID.
On the Instance Details tab, you can find that the endpoint of the instance is the specified private IP address.
References
For more information about how to create a CLB instance in the CLB console, see Create and manage CLB instances.
For more information about how to specify private IP addresses for an Application Load Balancer (ALB) instance, see Use OpenAPI Explorer to create an ALB instance and assign private IP addresses.
For more information about how to specify private IP addresses for a Network Load Balancer (NLB) instance, see Specify private IP addresses when you create an NLB instance by using OpenAPI Explorer.