All Products
Search
Document Center

Server Load Balancer:Specify a private IP address when you use OpenAPI Explorer to create a CLB instance

Last Updated:Jan 12, 2024

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

  1. Log on to OpenAPI Explorer.

  2. 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

    Note

    If 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

    Note

    This 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

  3. 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.

  4. 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.

    1. In the top navigation bar, select the China (Shanghai) region.

    2. On the Instances page, find the instance and click its ID.

    3. On the Instance Details tab, you can find that the endpoint of the instance is the specified private IP address.

References