tencentcloud.rst 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  1. ==================================
  2. Getting Started With Tencent Cloud
  3. ==================================
  4. Tencent Cloud is a secure, reliable and high-performance cloud compute service
  5. provided by Tencent. It is the 2nd largest Cloud Provider in China.
  6. Dependencies
  7. ============
  8. The Tencent Cloud driver for Salt Cloud requires the ``tencentcloud-sdk-python`` package,
  9. which is available at PyPI:
  10. https://pypi.org/project/tencentcloud-sdk-python/
  11. This package can be installed using ``pip`` or ``easy_install``:
  12. .. code-block:: bash
  13. # pip install tencentcloud-sdk-python
  14. # easy_install tencentcloud-sdk-python
  15. Provider Configuration
  16. ======================
  17. To use this module, set up the cloud configuration at
  18. ``/etc/salt/cloud.providers`` or ``/etc/salt/cloud.providers.d/*.conf``:
  19. .. code-block:: yaml
  20. my-tencentcloud-config:
  21. driver: tencentcloud
  22. # Tencent Cloud Secret Id
  23. id: AKIDA64pOio9BMemkApzevX0HS169S4b750A
  24. # Tencent Cloud Secret Key
  25. key: 8r2xmPn0C5FDvRAlmcJimiTZKVRsk260
  26. # Tencent Cloud Region
  27. location: ap-guangzhou
  28. Configuration Parameters
  29. ~~~~~~~~~~~~~~~~~~~~~~~~
  30. driver
  31. ------
  32. **Required**. ``tencentcloud`` to use this module.
  33. id
  34. --
  35. **Required**. Your Tencent Cloud secret id.
  36. key
  37. ---
  38. **Required**. Your Tencent Cloud secret key.
  39. location
  40. --------
  41. **Optional**. If this value is not specified, the default is ``ap-guangzhou``.
  42. Available locations can be found using the ``--list-locations`` option:
  43. .. code-block:: bash
  44. # salt-cloud --list-location my-tencentcloud-config
  45. Profile Configuration
  46. =====================
  47. Tencent Cloud profiles require a ``provider``, ``availability_zone``, ``image`` and ``size``.
  48. Set up an initial profile at ``/etc/salt/cloud.profiles`` or ``/etc/salt/cloud.profiles.d/*.conf``:
  49. .. code-block:: yaml
  50. tencentcloud-guangzhou-s1sm1:
  51. provider: my-tencentcloud-config
  52. availability_zone: ap-guangzhou-3
  53. image: img-31tjrtph
  54. size: S1.SMALL1
  55. allocate_public_ip: True
  56. internet_max_bandwidth_out: 1
  57. password: '153e41ec96140152'
  58. securitygroups:
  59. - sg-5e90804b
  60. Configuration Parameters
  61. ~~~~~~~~~~~~~~~~~~~~~~~~
  62. provider
  63. --------
  64. **Required**. Name of entry in ``salt/cloud.providers.d/???`` file.
  65. availability_zone
  66. -----------------
  67. **Required**. The availability zone that the instance is located in.
  68. Available zones can be found using the ``list_availability_zones`` function:
  69. .. code-block:: bash
  70. # salt-cloud -f list_availability_zones my-tencentcloud-config
  71. image
  72. -----
  73. **Required**. The image id to use for the instance.
  74. Available images can be found using the ``--list-images`` option:
  75. .. code-block:: bash
  76. # salt-cloud --list-images my-tencentcloud-config
  77. size
  78. ----
  79. **Required**. Instance type for instance can be found using the ``--list-sizes`` option.
  80. .. code-block:: bash
  81. # salt-cloud --list-sizes my-tencentcloud-config
  82. securitygroups
  83. --------------
  84. **Optional**. A list of security group ids to associate with.
  85. Available security group ids can be found using the ``list_securitygroups`` function:
  86. .. code-block:: bash
  87. # salt-cloud -f list_securitygroups my-tencentcloud-config
  88. Multiple security groups are supported:
  89. .. code-block:: yaml
  90. tencentcloud-guangzhou-s1sm1:
  91. securitygroups:
  92. - sg-5e90804b
  93. - sg-8kpynf2t
  94. hostname
  95. --------
  96. **Optional**. The hostname of the instance.
  97. instance_charge_type
  98. --------------------
  99. **Optional**. The charge type of the instance. Valid values are ``PREPAID``,
  100. ``POSTPAID_BY_HOUR`` and ``SPOTPAID``. The default is ``POSTPAID_BY_HOUR``.
  101. instance_charge_type_prepaid_renew_flag
  102. ---------------------------------------
  103. **Optional**. When enabled, the instance will be renew automatically
  104. when it reaches the end of the prepaid tenancy.
  105. Valid values are ``NOTIFY_AND_AUTO_RENEW``, ``NOTIFY_AND_MANUAL_RENEW`` and ``DISABLE_NOTIFY_AND_MANUAL_RENEW``.
  106. .. note::
  107. This value is only used when ``instance_charge_type`` is set to ``PREPAID``.
  108. instance_charge_type_prepaid_period
  109. -----------------------------------
  110. **Optional**. The tenancy time in months of the prepaid instance,
  111. Valid values are ``1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 24, 36``.
  112. .. note::
  113. This value is only used when ``instance_charge_type`` is set to ``PREPAID``.
  114. allocate_public_ip
  115. ------------------
  116. **Optional**. Associate a public ip address with an instance
  117. in a VPC or Classic. Boolean value, default is ``false``.
  118. internet_max_bandwidth_out
  119. --------------------------
  120. **Optional**. Maximum outgoing bandwidth to the public network, measured in Mbps (Mega bits per second).
  121. Value range: ``[0, 100]``. If this value is not specified, the default is ``0`` Mbps.
  122. internet_charge_type
  123. --------------------
  124. **Optional**. Internet charge type of the instance. Valid values are ``BANDWIDTH_PREPAID``,
  125. ``TRAFFIC_POSTPAID_BY_HOUR``, ``BANDWIDTH_POSTPAID_BY_HOUR`` and ``BANDWIDTH_PACKAGE``.
  126. The default is ``TRAFFIC_POSTPAID_BY_HOUR``.
  127. key_name
  128. --------
  129. **Optional**. The key pair to use for the instance, for example ``skey-16jig7tx``.
  130. password
  131. --------
  132. **Optional**. Login password for the instance.
  133. private_ip
  134. ----------
  135. **Optional**. The private ip to be assigned to this instance,
  136. must be in the provided subnet and available.
  137. project_id
  138. ----------
  139. **Optional**. The project this instance belongs to, defaults to ``0``.
  140. vpc_id
  141. ------
  142. **Optional**. The id of a VPC network.
  143. If you want to create instances in a VPC network, this parameter must be set.
  144. subnet_id
  145. ---------
  146. **Optional**. The id of a VPC subnet.
  147. If you want to create instances in VPC network, this parameter must be set.
  148. system_disk_size
  149. ----------------
  150. **Optional**. Size of the system disk.
  151. Value range: ``[50, 1000]``, and unit is ``GB``. Default is ``50`` GB.
  152. system_disk_type
  153. ----------------
  154. **Optional**. Type of the system disk.
  155. Valid values are ``CLOUD_BASIC``, ``CLOUD_SSD`` and ``CLOUD_PREMIUM``, default value is ``CLOUD_BASIC``.
  156. Actions
  157. =======
  158. The following actions are supported by the Tencent Cloud Salt Cloud driver.
  159. show_instance
  160. ~~~~~~~~~~~~~
  161. This action is a thin wrapper around ``--full-query``, which displays details on a
  162. single instance only. In an environment with several machines, this will save a
  163. user from having to sort through all instance data, just to examine a single
  164. instance.
  165. .. code-block:: bash
  166. $ salt-cloud -a show_instance myinstance
  167. show_disk
  168. ~~~~~~~~~
  169. Return disk details about a specific instance.
  170. .. code-block:: bash
  171. $ salt-cloud -a show_disk myinstance
  172. destroy
  173. ~~~~~~~
  174. Destroy a Tencent Cloud instance.
  175. .. code-block:: bash
  176. $ salt-cloud -a destroy myinstance
  177. start
  178. ~~~~~
  179. Start a Tencent Cloud instance.
  180. .. code-block:: bash
  181. $ salt-cloud -a start myinstance
  182. stop
  183. ~~~~
  184. Stop a Tencent Cloud instance.
  185. .. code-block:: bash
  186. $ salt-cloud -a stop myinstance
  187. reboot
  188. ~~~~~~
  189. Reboot a Tencent Cloud instance.
  190. .. code-block:: bash
  191. $ salt-cloud -a reboot myinstance
  192. Functions
  193. =========
  194. The following functions are currently supported by the Tencent Cloud Salt Cloud driver.
  195. list_securitygroups
  196. ~~~~~~~~~~~~~~~~~~~
  197. Lists all Tencent Cloud security groups in current region.
  198. .. code-block:: bash
  199. $ salt-cloud -f list_securitygroups my-tencentcloud-config
  200. list_availability_zones
  201. ~~~~~~~~~~~~~~~~~~~~~~~
  202. Lists all Tencent Cloud availability zones in current region.
  203. .. code-block:: bash
  204. $ salt-cloud -f list_availability_zones my-tencentcloud-config
  205. list_custom_images
  206. ~~~~~~~~~~~~~~~~~~
  207. Lists any custom images associated with the account. These images can
  208. be used to create a new instance.
  209. .. code-block:: bash
  210. $ salt-cloud -f list_custom_images my-tencentcloud-config
  211. show_image
  212. ~~~~~~~~~~
  213. Return details about a specific image. This image can be used
  214. to create a new instance.
  215. .. code-block:: bash
  216. $ salt-cloud -f show_image tencentcloud image=img-31tjrtph