All Products
Search
Document Center

Server Load Balancer:CreateLoadBalancer

Last Updated:Sep 08, 2026

Creates an SLB instance.

Operation description

Note

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

slb:CreateLoadBalancer

create

*LoadBalancer

acs:slb:{#regionId}:{#accountId}:loadbalancer/*

  • slb:AddressType
None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The region ID of the Classic Load Balancer (CLB) instance.

You can call DescribeRegions to query region IDs.

cn-hangzhou

AddressType

string

No

The network type of the Classic Load Balancer (CLB) instance. Valid values:

  • internet: After an Internet-facing SLB instance is created, the system allocates a public IP address to the instance so that the instance can forward requests from the Internet.

  • intranet: After an internal-facing Server Load Balancer instance of the VPC type is created, the system allocates an internal network IP address to the instance so that the instance can forward only internal network requests.

internet

InternetChargeType

string

No

The metering method of the Internet-facing instance. Valid values:

  • paybytraffic (default): pay-by-data-transfer.

  • paybybandwidth: pay-by-bandwidth.

Note
  • If PayType is set to PayOnDemand and InstanceChargeType is set to PayByCLCU, this parameter supports only paybytraffic.

  • If you set this parameter to paybytraffic, you do not need to set the Bandwidth parameter. Even if you set the Bandwidth parameter, the value does not take effect.

paybytraffic

Bandwidth

integer

No

The maximum bandwidth of the instance. Unit: Mbit/s.

Valid values: 1 to 5000.

Note

This parameter takes effect only when AddressType is set to internet and InternetChargeType is set to paybybandwidth.

10

ClientToken

string

No

The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests.

Note

If you do not specify this parameter, the system uses the RequestId of the API request as the ClientToken. The RequestId may be different for each API request.

593B0448-D13E-4C56-AC0D-FDF0FDE0E9A3

LoadBalancerName

string

No

The name of the Server Load Balancer instance.

The name must be 1 to 80 characters in length and can contain letters, digits, periods (.), underscores (_), and hyphens (-). It must start with a letter or a Chinese character.

If you do not specify this parameter, the system automatically allocates a default name to the instance.

lb-bp1o94dp5i6ea****

VpcId

string

No

The ID of the VPC to which the Server Load Balancer instance belongs.

vpc-bp1aevy8sofi8mh1****

VSwitchId

string

No

The ID of the vSwitch to which the SLB instance belongs.

To create a VPC-type Server Load Balancer instance, you must specify this parameter. If you specify this parameter, the value of AddressType is automatically set to intranet.

Note

Make sure that the vSwitch specified by VSwitchId is in the same zone as the primary zone.

vsw-bp12mw1f8k3jgy****

MasterZoneId

string

No

The primary zone ID of the Server Load Balancer instance.

You can call DescribeZone to query the primary and secondary zones in a region.

Note

Make sure that the primary zone is in the same zone as the vSwitch specified by VSwitchId.

cn-hangzhou-b

SlaveZoneId

string

No

The secondary zone ID of the Server Load Balancer instance.

You can call DescribeZone to query the primary and secondary zones in a region.

cn-hangzhou-d

LoadBalancerSpec

string

No

The specification of the SLB instance. Valid values:

  • slb.s1.small

  • slb.s2.small

  • slb.s2.medium

  • slb.s3.small

  • slb.s3.medium

  • slb.s3.large

Note
  • If InstanceChargeType is set to PayByCLCU, this parameter does not take effect and you do not need to specify it.

  • Pay-by-specification Classic Load Balancer (CLB) instances are no longer available for purchase since 00:00:00 (UTC+8) on June 1, 2025. For details, see Notice on the discontinuation of pay-by-specification CLB instances.

slb.s1.small

ResourceGroupId

string

No

The ID of the enterprise resource group.

rg-atstuj3rtopt****

PayType deprecated

string

No

The billing method of the instance. Valid values:

  • PayOnDemand: pay-as-you-go.

PayOnDemand

PricingCycle deprecated

string

No

The billing cycle of the subscription Internet-facing instance. Valid values:

  • month

  • year

Note

This parameter is applicable only to China site (aliyun.com) and is valid only for subscription instances.

month

Duration deprecated

integer

No

The subscription duration of the Internet-facing instance. Valid values:

  • If PricingCycle is set to month, valid values are 1 to 9.

  • If PricingCycle is set to year, valid values are 1 to 5.

Note

This parameter is applicable only to China site (aliyun.com) and is valid only for subscription instances.

1

AutoPay deprecated

boolean

No

Specifies whether to automatically pay for the subscription Internet-facing instance. Valid values:

  • true: Automatic payment is automatically completed. After you call this operation, the SLB instance is immediately created.

  • false (default): After you call this operation, the order is created but automatic payment is not completed. You can view the unpaid order in the console. Because the order is not paid, the SLB instance is not created.

Note

This parameter is applicable only to China site (aliyun.com) and is valid only for subscription instances.

true

AddressIPVersion

string

No

The IP version of the Server Load Balancer instance. Valid values: ipv4 and ipv6.

ipv4

Address

string

No

The private IP address of the instance. The IP address must be within the CIDR block of the vSwitch.

192.168.XX.XX

Tag

array<object>

No

The tags.

object

No

The tags.

Key

string

No

The tag key of the instance. Valid values of N: 1 to 20. The tag key cannot be an empty string.

The tag key can be up to 64 characters in length and cannot start with aliyun or acs:. It cannot contain http:// or https://.

test

Value

string

No

The tag value of the instance. Valid values of N: 1 to 20. The tag value can be an empty string. The tag value can be up to 128 characters in length and cannot start with aliyun or acs:. It cannot contain http:// or https://.

value

DeleteProtection

string

No

Specifies whether to enable deletion protection. Valid values:

  • on: enabled.

  • off: disabled.

on

ModificationProtectionStatus

string

No

The configuration read-only mode of the Classic Load Balancer (CLB) instance. Valid values:

  • NonProtection: Configuration read-only mode is disabled. The value of ModificationProtectionReason is cleared when you set this value.

  • ConsoleProtection: Configuration read-only mode is enabled for the console.

Note

If you set this parameter to ConsoleProtection to enable configuration read-only mode, you cannot modify instance configurations in the Server Load Balancer console. However, you can call API operations to modify instance configurations.

ConsoleProtection

ModificationProtectionReason

string

No

The reason for enabling configuration read-only mode. The reason must be 1 to 80 characters in length and must start with a letter or a Chinese character. It can contain digits, periods (.), underscores (_), and hyphens (-).

Note

This parameter takes effect only when ModificationProtectionStatus is set to ConsoleProtection.

Managed instance

InstanceChargeType

string

No

The billing method of the instance.

Valid values: PayByCLCU: pay-by-usage.

Note

PayBySpec

Response elements

Element

Type

Description

Example

object

VpcId

string

The ID of the VPC to which the Server Load Balancer instance belongs.

vpc-25dvzy9****

AddressIPVersion

string

The IP address type of the Server Load Balancer instance.

ipv4

VSwitchId

string

The ID of the vSwitch to which the Server Load Balancer instance belongs.

vsw-255ecr****

RequestId

string

The request ID.

365F4154-92F6-4AE4-92F8-7FF34B540710

LoadBalancerName

string

The name of the Server Load Balancer instance.

lb-bp1o94dp5i6ea****

LoadBalancerId

string

The ID of the Server Load Balancer instance.

lb-hddhfjg****

ResourceGroupId

string

The resource group ID.

rg-atstuj3rto****

Address

string

The IP address allocated to the SLB instance.

42.XX.XX.6

NetworkType

string

The network type of the Server Load Balancer instance. Valid values:

  • vpc: VPC.

  • classic: classic network.

classic

OrderId

integer

The order ID of the subscription instance.

20212961978****

Examples

Success response

JSON format

{
  "VpcId": "vpc-25dvzy9****",
  "AddressIPVersion": "ipv4",
  "VSwitchId": "vsw-255ecr****",
  "RequestId": "365F4154-92F6-4AE4-92F8-7FF34B540710",
  "LoadBalancerName": "lb-bp1o94dp5i6ea****",
  "LoadBalancerId": "lb-hddhfjg****",
  "ResourceGroupId": "rg-atstuj3rto****",
  "Address": "42.XX.XX.6",
  "NetworkType": "classic",
  "OrderId": 0
}

Error codes

HTTP status code

Error code

Error message

Description

400 OperationFailed.ZoneResourceLimit The operation failed because of resource limit of the specified zone. The operation failed due to insufficient resources in the current zone.
400 CloudBoxNotSupportIpv6 The cloudBox instance does not support ipv6. CloudBox instances do not support IPv6.
400 CloudBoxNotSupportInternet The cloudBox instance does not support internet. CloudBox instances do not support Internet access.
400 OperationFailed.RegionResourceLimit The operation failed because of resource limit of the specified region. The operation failed due to insufficient resources in the specified region.
400 Operation.NotAllowed Operation Denied. The charge type of internet prepay instance can only be paybybandwidth. The operation is restricted. This operation is not allowed.
400 OperationFailed.UnpaidBillsExist The account has unpaid bills. Please pay your overdue bill first. The operation failed because your account has unpaid bills. Pay your overdue bills first.
400 RegionOrZonesNotSupportIpv6 The specified region or master/slave zones does not support ipv6. The specified region or primary/secondary zone does not support IPv6.
400 InvalidParameter.Mismatch AddressType and IpVersion is conflict, IPv6 does not support intranet instance. The network type conflicts with the IP version. Internal-facing SLB instances do not support IPv6.
400 PAYFOR.CREDIT_PAY_INSUFFICIENT_BALANCE Your account does not have enough balance.
400 HighRiskOperationDenied The operation is denied because of high risk. The operation is denied because the current operation is a high-risk operation.
400 VSwitchAvailableIpNotExist The specified VSwitch has no availabe ip. The specified vSwitch does not have any available IP addresses.
400 VSwitchNotExist The specified VSwitch does not exist. The specified vSwitch does not exist.
400 InvalidParameter Illegal parameter. The IP address is not in subnet. The Vgw ip is empty. Specify the Vgw ip parameter.
400 Instance.ShareSlbNotSupportPay95 Illegal parameter. The share instance not support PayBy95 or PayByOld95. Shared-resource instances do not support PayBy95 or PayByOld95.
400 Instance.Pay95RateInvalid Illegal parameter. The rate is illegal. The specified Rate is invalid. Check the parameter constraints and try again.
400 Instance.Pay95BandwidthIllegal Illegal parameter. The bandwidth is illegal. The specified Bandwidth is invalid. Check the parameter constraints and try again.
400 Instance.InternetChargeTypeNotAllowed Illegal parameter. The specified InternetChargeType not allowed. The parameter is invalid. The specified InternetChargeType is not supported.
400 OperationFailed.TokenIsProcessing The operation is failed, because the Client Token is processing. The operation failed because the current request is being processed.
400 InsufficientBalance Your account does not have enough balance. Your account balance is insufficient. Top up your account and try again.
400 MissingParam.VSwitchId The parameter VSwitchId is required. The VSwitchId parameter is missing.
400 InvalidVpcId.NotExist The specified VPC not exist. The specified VPC does not exist.
400 PAY.MAYI_WITHHOLDING_AGREEMENT_ILLEGAL Your account did not sign a withholding agreement or no coupons in Alipay.
400 InvalidParameter.CloudType The specified CloudType is invalid. The specified CloudType is invalid. Check the parameter constraints and try again after making corrections.
400 OperationFailed.InvalidAccount The account information is incomplete. The operation failed because the account information is incomplete.
400 RegionOrZonesNotSupportCEN The specified region or master/slave zones does not support cloudType of hybrid_cen. The specified region or primary/secondary zone does not support CEN.
400 MissingParam.LoadBalancerSpec The param LoadBalancerSpec is required. The LoadBalancerSpec parameter is missing.
400 InvalidParameter.Bandwidth The param Bandwidth is invalid. The specified Bandwidth is invalid. Check the parameter constraints and try again.
400 OperationForbidden.AccountRiskReject The operation failed because of account risk reject. The operation failed because the current account has been flagged by risk control.
400 OperationForbidden.QuotaLimit The operation failed because of quota limit of shared loadbalancers. The operation failed because the number of shared-resource instances has reached the quota limit.
400 InvalidParam.ModificationProtectionStatus The param ModificationProtectionStatus is invalid. The specified ModificationProtectionStatus is invalid. Check the parameter constraints and try again after you make modifications.
400 InvalidParam.ModificationProtectionReason The param ModificationProtectionReason is invalid. The specified ModificationProtectionReason is invalid. Check the parameter constraints and try again after you make modifications.
400 ShareSlbHaltSales The share instance has been discontinued. Shared-resource SLB instances are sold out.
400 OperationFailed.CashBookInsufficient No payment method is specified for your account, We recommend that you add a payment method or maintain a prepayment balance. The operation failed because your account does not have a specified payment method. Add a payment method or maintain a prepayment balance.
400 OperationFailed.OnlyInnerCommoditySupportToPurchase AliCroup2Cloud user only can buy inner commodity. The operation failed because enterprise cloud users can only purchase internal products.
400 OperationFailed.InvokeLingXiaoFailed Failed to invoke lingxiao service. The operation failed because the call to the Lingxiao service failed.
400 AllocateVpcInstanceFailed Failed to allocate vpc instance. Failed to allocate a VPC-connected instance.
400 QueryCreditCtrlInfoFailed Failed to query credit ctrl info. Failed to query the user information.
400 QueryCommodityCenterFailed Failed to query commodity center. Failed to query the commodity center.
400 RegionNotSupportParameter Current region does not support the param of %s. The specified parameter is not supported in the current region.
400 QueryAccountBookInfoFailed Failed to invoke account book info. Failed to call the ledger information.
400 RateAccountFailed Failed to rate account for pricing. Failed to call the pricing service.
400 TradeWaitDistributorAudit The trade needs distributor to audit. This transaction is pending review by the reseller.
400 OperationFailed.InvokeProxyFailed Failed to invoke proxy. The operation failed because the call to the management service failed.
400 QueryAccountCompleteProgressFailed Failed to query account progress. Failed to query the account progress.
400 QueryVoucherInfoFailed Failed to query voucher info. Failed to query the credential information.
400 InvalidVSwitchId.NotFound The specified vSwitch instance is invalid. The current specified vswitch instance is illegal.
400 IllegalParam.SpecType The param of SpecType is illegal. The specified SpecType is invalid. Check the parameter constraints and try again.
400 MissingParam.SpecType The param of SpecType is missing. The SpecType parameter is missing.
400 UnsupportedRegion The feature is not supported in current region. The resource hosting feature is not supported in the current region.
400 PayInsufficientBalance Your account balance is insufficient. The balance of your account is insufficient.
400 IllegalParam.InstanceChargeType The parameter InstanceChargeType is illegal.
400 SystemBusy The system is busy. System Busy
400 PRODUCT.NOT_AVAILABLE_IZ The Instance zone id doesn t support The specified zone ID of the instance is not supported.
400 PRICE.INQUIRY_FAILED The instance pricing inquiry is failed. Failed to query the instance pricing.
400 AssociateIpFail The instance associating ip is failed.
400 SDK.ServerUnreachable Service is unreachable. The service is temporarily unavailable. Try again later.
400 OverQuota The Total is over the quota Total amount has reach the limit. Reduce the quantity and try again.
400 InvalidParam.TagValue %s.
400 InvalidParam.TagKey %s.
400 SizeLimitExceeded.Tag %s.
400 MissingParam.TagKey The param MissingParam.TagKey is missing.
400 SubnetIpExhaust No subnet IP addresses are available. No subnet IP address is available.
400 BeforePayRuleBatchValidateError The pre-payment rule center instance rule validation failed. Please check if the instance limit has been reached. The rule center instance rule verification failed before payment. Check whether the instance limit has been reached.
400 TradeSyncCreateSubError Subscription transfer failed. The subscription conversion failed. Try again later.
400 QueryOrderError Failed to query the order. Please try again later. Failed to query the order. Try again later.
400 CreateOrderTimeout Order creation timed out. Please try again later. The order creation timed out. Try again later.
400 MultiGrayKeyResourceInconsist The identifier for the gray resource is set incorrectly. The identifier for the canary release resource is incorrectly configured.
400 InsufficientAvailableQuota Your account available balance is less than 0. Please recharge before attempting to make a purchase. Your account balance is less than 0. Top up your account and try again.
400 Forbidden.AliGroupForbiddenRegion Thre region is forbidden for aligroup user.
403 SecurityRisk.AuthVerification We have detected a security risk with your payment method. Please proceed with verification via the link in your email or console message and re-submit your order after verification. We have detected a security risk with your payment method. Please proceed with verification via the link in your email or console message and re-submit your order after verification.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.