doc/topics/cloud/tencentcloud.rst
Tencent Cloud is a secure, reliable and high-performance cloud compute service provided by Tencent. It is the 2nd largest Cloud Provider in China.
The Tencent Cloud driver for Salt Cloud requires the tencentcloud-sdk-python package,
which is available at PyPI:
https://pypi.org/project/tencentcloud-sdk-python/
This package can be installed using pip or easy_install:
.. code-block:: bash
To use this module, set up the cloud configuration at
/etc/salt/cloud.providers or /etc/salt/cloud.providers.d/*.conf:
.. code-block:: yaml
my-tencentcloud-config:
driver: tencentcloud
# Tencent Cloud Secret Id
id: AKIDA64pOio9BMemkApzevX0HS169S4b750A
# Tencent Cloud Secret Key
key: 8r2xmPn0C5FDvRAlmcJimiTZKVRsk260
# Tencent Cloud Region
location: ap-guangzhou
Configuration Parameters
driver
------
**Required**. ``tencentcloud`` to use this module.
id
--
**Required**. Your Tencent Cloud secret id.
key
---
**Required**. Your Tencent Cloud secret key.
location
--------
**Optional**. If this value is not specified, the default is ``ap-guangzhou``.
Available locations can be found using the ``--list-locations`` option:
.. code-block:: bash
# salt-cloud --list-location my-tencentcloud-config
Profile Configuration
=====================
Tencent Cloud profiles require a ``provider``, ``availability_zone``, ``image`` and ``size``.
Set up an initial profile at ``/etc/salt/cloud.profiles`` or ``/etc/salt/cloud.profiles.d/*.conf``:
.. code-block:: yaml
tencentcloud-guangzhou-s1sm1:
provider: my-tencentcloud-config
availability_zone: ap-guangzhou-3
image: img-31tjrtph
size: S1.SMALL1
allocate_public_ip: True
internet_max_bandwidth_out: 1
password: '153e41ec96140152'
securitygroups:
- sg-5e90804b
Configuration Parameters
Required. Name of entry in salt/cloud.providers.d/??? file.
Required. The availability zone that the instance is located in.
Available zones can be found using the list_availability_zones function:
.. code-block:: bash
# salt-cloud -f list_availability_zones my-tencentcloud-config
Required. The image id to use for the instance.
Available images can be found using the --list-images option:
.. code-block:: bash
# salt-cloud --list-images my-tencentcloud-config
Required. Instance type for instance can be found using the --list-sizes option.
.. code-block:: bash
# salt-cloud --list-sizes my-tencentcloud-config
Optional. A list of security group ids to associate with.
Available security group ids can be found using the list_securitygroups function:
.. code-block:: bash
# salt-cloud -f list_securitygroups my-tencentcloud-config
Multiple security groups are supported:
.. code-block:: yaml
tencentcloud-guangzhou-s1sm1:
securitygroups:
- sg-5e90804b
- sg-8kpynf2t
Optional. The hostname of the instance.
Optional. The charge type of the instance. Valid values are PREPAID,
POSTPAID_BY_HOUR and SPOTPAID. The default is POSTPAID_BY_HOUR.
Optional. When enabled, the instance will be renew automatically
when it reaches the end of the prepaid tenancy.
Valid values are NOTIFY_AND_AUTO_RENEW, NOTIFY_AND_MANUAL_RENEW and DISABLE_NOTIFY_AND_MANUAL_RENEW.
.. note::
This value is only used when ``instance_charge_type`` is set to ``PREPAID``.
Optional. The tenancy time in months of the prepaid instance,
Valid values are 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 24, 36.
.. note::
This value is only used when ``instance_charge_type`` is set to ``PREPAID``.
Optional. Associate a public ip address with an instance
in a VPC or Classic. Boolean value, default is false.
Optional. Maximum outgoing bandwidth to the public network, measured in Mbps (Mega bits per second).
Value range: [0, 100]. If this value is not specified, the default is 0 Mbps.
Optional. Internet charge type of the instance. Valid values are BANDWIDTH_PREPAID,
TRAFFIC_POSTPAID_BY_HOUR, BANDWIDTH_POSTPAID_BY_HOUR and BANDWIDTH_PACKAGE.
The default is TRAFFIC_POSTPAID_BY_HOUR.
Optional. The key pair to use for the instance, for example skey-16jig7tx.
Optional. Login password for the instance.
Optional. The private ip to be assigned to this instance, must be in the provided subnet and available.
Optional. The project this instance belongs to, defaults to 0.
Optional. The id of a VPC network. If you want to create instances in a VPC network, this parameter must be set.
Optional. The id of a VPC subnet. If you want to create instances in VPC network, this parameter must be set.
Optional. Size of the system disk.
Value range: [50, 1000], and unit is GB. Default is 50 GB.
Optional. Type of the system disk.
Valid values are CLOUD_BASIC, CLOUD_SSD and CLOUD_PREMIUM, default value is CLOUD_BASIC.
The following actions are supported by the Tencent Cloud Salt Cloud driver.
show_instance
This action is a thin wrapper around ``--full-query``, which displays details on a
single instance only. In an environment with several machines, this will save a
user from having to sort through all instance data, just to examine a single
instance.
.. code-block:: bash
$ salt-cloud -a show_instance myinstance
show_disk
~~~~~~~~~
Return disk details about a specific instance.
.. code-block:: bash
$ salt-cloud -a show_disk myinstance
destroy
~~~~~~~
Destroy a Tencent Cloud instance.
.. code-block:: bash
$ salt-cloud -a destroy myinstance
start
~~~~~
Start a Tencent Cloud instance.
.. code-block:: bash
$ salt-cloud -a start myinstance
stop
~~~~
Stop a Tencent Cloud instance.
.. code-block:: bash
$ salt-cloud -a stop myinstance
reboot
~~~~~~
Reboot a Tencent Cloud instance.
.. code-block:: bash
$ salt-cloud -a reboot myinstance
Functions
=========
The following functions are currently supported by the Tencent Cloud Salt Cloud driver.
list_securitygroups
Lists all Tencent Cloud security groups in current region.
.. code-block:: bash
$ salt-cloud -f list_securitygroups my-tencentcloud-config
list_availability_zones
Lists all Tencent Cloud availability zones in current region.
.. code-block:: bash
$ salt-cloud -f list_availability_zones my-tencentcloud-config
list_custom_images
~~~~~~~~~~~~~~~~~~
Lists any custom images associated with the account. These images can
be used to create a new instance.
.. code-block:: bash
$ salt-cloud -f list_custom_images my-tencentcloud-config
show_image
~~~~~~~~~~
Return details about a specific image. This image can be used
to create a new instance.
.. code-block:: bash
$ salt-cloud -f show_image tencentcloud image=img-31tjrtph