AliCloud CPI Cloud Properties¶
This topic describes cloud properties for different resources created by the Alibaba Cloud CPI.
AZs¶
Schema for cloud_properties section:
- availability_zone [String, required]: Availability zone to use for creating instances.
- Example:
us-east-1a.
- Example:
Example:
azs:
- name: z1
cloud_properties:
availability_zone: us-east-1a
Networks¶
Schema for cloud_properties section used by dynamic network or manual network subnet:
- vswitch_id [String, required]: VSwitch ID in which the instance will be created. Example:
vsw-123456abc. - security_group_ids [Array, optional]: Array of Security Groups, to apply to all VMs placed on this network. Security groups can be specified as follows, ordered by greatest precedence:
vm_types, followed bynetworks.
Example of manual network:
networks:
- name: default
type: manual
subnets:
- range: 10.10.0.0/24
gateway: 10.10.0.1
cloud_properties:
vswitch_id: vsw-123456abc
security_group_ids: [sg-abc12345]
Example of dynamic network:
networks:
- name: default
type: dynamic
cloud_properties:
vswitch_id: vsw-123456abc
Example of vip network:
networks:
- name: default
type: vip
VM Types / VM Extensions¶
Schema for cloud_properties section:
- instance_type [String, required]: Type of the instance.
- Example:
ecs.g5.large.
- Example:
- availability_zone [String, required]: Availability zone to use for creating instances.
- Example:
us-east-1a.
- Example:
- security_group_ids [Array, optional]: See description under networks. Available in v19+.
- key_pair_name [String, optional]: Key pair name.
- Example:
bosh.
- Example:
- spot_price_limit [Float, optional]: Bid price in RMB for Alibaba Cloud spot instance. Using this option will slow down VM creation.
- Example:
0.03.
- Example:
- spot_strategy [String, optional]: Sets an expected spot price if you are creating preemptible instances. It takes effect only when parameter InstanceChargeType is PostPaid. Options:
NoSpotA normal Pay-As-You-Go instance.SpotWithPriceLimitSets the price threshold for a preemptible instance.SpotAsPriceGoA price that is based on the highest Pay-As-You-Go instance.- Default is
NoSpot.
- slbs [Array, optional]: Array of Load balancer Ids used to add created VMs to default slb server group. Example:
[lb-abc123456].- Default is
[].
- Default is
- slb_weight [Integer, optional]: The weight value used to add created VMs to default slb server group. Example:
80.- Default is
100.
- Default is
- slb_server_group [Array, optional]: Array of SLB virtual server group Ids used to attach created VMs. Example:
[sgp-abc123456].- Default is
[].
- Default is
- slb_server_group_port [Integer, optional]: The port value used to attach created VMs with SLB virtual server group. It will be ignored when
slb_server_groupis not set. Example:8080.- Default is
33333.
- Default is
- slb_server_group_weight [Integer, optional]: The weight value used to attach created VMs with SLB virtual server group. It will be ignored when
slb_server_groupis not set. Example:80.- Default is
100.
- Default is
- nlb_server_group_ids [Array, optional, Available since v47.0.0]: Array of NLB virtual server group Ids used to attach created VMs. Example:
[rgp-abc123456].- Default is
[].
- Default is
- nlb_server_group_port [Integer, optional, Available since v47.0.0]: The port value used to attach created VMs with NLB virtual server group. It will be ignored when
nlb_server_group_idsis not set. Example:8080.- Default is `
`\.
- Default is `
- nlb_server_group_weight [Integer, optional, Available since v47.0.0]: The weight value used to attach created VMs with NLB virtual server group. It will be ignored when
nlb_server_group_idsis not set. Example:80.- Default is
100.
- Default is
- ram_role_name [String, optional]: Instance RAM role name. The name is provided and maintained by RAM and can be queried using ListRoles.
For more information, see CreateRole and ListRoles.
Example:
director. - instance_name [String, optional]: The instance name. It is a string of 2 to 128 English letters and special characters. It must begin with an English or a Chinese character. It can contain digits, periods (.), colons (:), underscores (_), and hyphens (-), but cannot begin with http:// or https://.
- The default value is the
InstanceIdof the instance.
- The default value is the
- passowrd [String, optional]: Password of the ECS instance. It can be [8, 30] characters in length. It must contain uppercase and lowercase letters, digits. The following special characters are allowed: @ # $ % ^ & * - + = | { } [ ] : ; ‘ < > , . ? /
-
charge_type [String, optional]: Billing methods. Optional values:
PrePaidMonthly, or annual subscription. Make sure that your registered credit card is invalid or you have insufficient balance in your PayPal account. Otherwise, InvalidPayMethod error may occur.PostPaidPay-As-You-Go.- Default is
PostPaid.
-
charge_period [Integer, optional]: The charge period of
PrePaidinstance. The value depends oncharge_period_unit. - charge_period_unit [String, optional]: The charge period unit of
PrePaidinstance. Optional values: Week | Month. When PeriodUnit is Week, period can be one of {“1”, “2”, “3”, “4”}. When PeriodUnit is Month, period can be one of { “1”, “2”, “3”, “4”, “5”, “6”, “7”, “8”, “9”, “12”, “24”, “36”,”48”,”60”}.- Default is
Month.
- Default is
- auto_renew [Boolean, optional]: Whether to set AutoRenew. This parameter is valid when InstanceChargeType is PrePaid. Optional values:
trueEnable automatic renewal.falseDisable automatic renewal.- Default is
false.
-
auto_renew_period [Integer, optional]: When AutoRenew is set to True, this parameter is required. When PeriodUnit is Week, AutoRenewPeriod can be one of {“1”, “2”, “3”}. When PeriodUnit is Month, AutoRenewPeriod can be one of {“1”, “2”, “3”, “6”, “12”}.
-
region [String, optional]: Alibaba Cloud region id. Example:
us-east-1. Available in v19+.- Defaults to region specified by
regionin global CPI settings.
- Defaults to region specified by
-
stemcell_id [String, optional]: The specified stemcell id used to launch instance. It can be used to cross-region deployment. Available in v19+.
-
ephemeral_disk [Hash, optional]: Elastic block storage data disk of custom size.
- Default disk size is either the size of first instance storage disk.
- size [Integer, required]: Specifies the disk size in megabytes.
- category [String, optional]: category of the Elastic block storage:
cloud_efficiency,cloud_ssd.cloud_efficiencyUltra cloud disk.cloud_ssdCloud SSD.- Default is
cloud_efficiency.
- encrypted [Boolean, optional] Enables encryption for the ephemeral disk. Defaults to
false. Overrides the globalencryptedproperty. - delete_with_instance [Boolean, optional] Whether a data disk is released along with the instance or not. Optional values:
trueThe disk is released with the instance.falseThe disk is not released with the instance.
- system_disk [Hash, optional]: Elastic block storage system disk of custom size.
- size [Integer, required]: Specifies the disk size in megabytes.
Example of an ecs.g5.large instance:
resource_pools:
- name: default
network: default
stemcell:
name: bosh-alicloud-kvm-ubuntu-xenial-go_agent
version: latest
cloud_properties:
instance_type: ecs.sn1ne.large
availability_zone: us-east-1a
Disk Types¶
Schema for cloud_properties section:
- category [String, optional]: category of the Elastic block storage:
cloud_efficiency,cloud_ssd.cloud_efficiencyUltra cloud disk.cloud_ssdCloud SSD.- Default is
cloud_efficiency.
- encrypted [Boolean, optional] Enables encryption for the ephemeral disk. Overrides the global
encryptedproperty.- Default is
false.
- Default is
- delete_with_instance [Boolean, optional] Whether a data disk is released along with the instance or not. Optional values:
trueThe disk is released with the instance.falseThe disk is not released with the instance.
Elastic block storage volumes are created in the availability zone of an instance that volume will be attached.
Example of 10GB disk:
disk_pools:
- name: default
disk_size: 10_240
cloud_properties:
category: cloud_efficiency
Global Configuration¶
The CPI can only talk to a single Alibaba Cloud region.
Schema:
- access_key_id [String, optional]: Access Key ID.
- Example:
AKI....
- Example:
- access_key_secret [String, optional]: Access Key Secret.
- Example:
0kwh....
- Example:
- security_token [String, optional]: AliCloud Security Token Service.
- Example:
0nwicsere....
- Example:
- region [String, required]: Alibaba Cloud region name.
- Example:
us-east-1
- Example:
- availability_zone [String, required]: Availability zone to use for creating instances.
- Example:
us-east-1a.
- Example:
- encrypted [Boolean, optional]: Turns on ECS disk encryption for all VM's data disks.
- Defaults is
false.
- Defaults is
Example with hard-coded credentials:
properties:
alicloud:
access_key_id: ACCESS-KEY-ID
access_key_secret: ACCESS-KEY-SECRET
region: us-east-1
Example Cloud Config¶
azs:
- name: z1
cloud_properties: {availability_zone: us-east-1a}
- name: z2
cloud_properties: {availability_zone: us-east-1b}
vm_types:
- name: default
cloud_properties:
instance_type: ecs.sn1ne.large
ephemeral_disk: {size: 3000, category: cloud_ssd}
- name: large
cloud_properties:
instance_type: ecs.c5.large
ephemeral_disk: {size: 30000, category: cloud_ssd}
disk_types:
- name: default
disk_size: 3000
- name: large
disk_size: 50_000
networks:
- name: default
type: manual
subnets:
- range: 10.10.0.0/24
gateway: 10.10.0.1
az: z1
static: [10.10.0.62]
dns: [10.10.0.2]
cloud_properties: {vswitch_id: vsw-f2744a86}
- range: 10.10.64.0/24
gateway: 10.10.64.1
az: z2
static: [10.10.64.121, 10.10.64.122]
dns: [10.10.0.2]
cloud_properties: {vswitch_id: vsw-eb8bd3ad}
- name: vip
type: vip
compilation:
workers: 5
reuse_compilation_vms: true
az: z1
vm_type: large
network: default