aliyun.rst 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. ===============================
  2. Getting Started With Aliyun ECS
  3. ===============================
  4. The Aliyun ECS (Elastic Computer Service) is one of the most popular public
  5. cloud hosts in China. This cloud host can be used to manage aliyun
  6. instance using salt-cloud.
  7. http://www.aliyun.com/
  8. Dependencies
  9. ============
  10. This driver requires the Python ``requests`` library to be installed.
  11. Configuration
  12. =============
  13. Using Salt for Aliyun ECS requires aliyun access key id and key secret.
  14. These can be found in the aliyun web interface, in the "User Center" section,
  15. under "My Service" tab.
  16. .. code-block:: yaml
  17. # Note: This example is for /etc/salt/cloud.providers or any file in the
  18. # /etc/salt/cloud.providers.d/ directory.
  19. my-aliyun-config:
  20. # aliyun Access Key ID
  21. id: wDGEwGregedg3435gDgxd
  22. # aliyun Access Key Secret
  23. key: GDd45t43RDBTrkkkg43934t34qT43t4dgegerGEgg
  24. location: cn-qingdao
  25. driver: aliyun
  26. .. note::
  27. .. versionchanged:: 2015.8.0
  28. The ``provider`` parameter in cloud provider definitions was renamed to ``driver``. This
  29. change was made to avoid confusion with the ``provider`` parameter that is used in cloud profile
  30. definitions. Cloud provider definitions now use ``driver`` to refer to the Salt cloud module that
  31. provides the underlying functionality to connect to a cloud host, while cloud profiles continue
  32. to use ``provider`` to refer to provider configurations that you define.
  33. Profiles
  34. ========
  35. Cloud Profiles
  36. ~~~~~~~~~~~~~~
  37. Set up an initial profile at ``/etc/salt/cloud.profiles`` or in the
  38. ``/etc/salt/cloud.profiles.d/`` directory:
  39. .. code-block:: yaml
  40. aliyun_centos:
  41. provider: my-aliyun-config
  42. size: ecs.t1.small
  43. location: cn-qingdao
  44. securitygroup: G1989096784427999
  45. image: centos6u3_64_20G_aliaegis_20130816.vhd
  46. Sizes can be obtained using the ``--list-sizes`` option for the ``salt-cloud``
  47. command:
  48. .. code-block:: bash
  49. # salt-cloud --list-sizes my-aliyun-config
  50. my-aliyun-config:
  51. ----------
  52. aliyun:
  53. ----------
  54. ecs.c1.large:
  55. ----------
  56. CpuCoreCount:
  57. 8
  58. InstanceTypeId:
  59. ecs.c1.large
  60. MemorySize:
  61. 16.0
  62. ...SNIP...
  63. Images can be obtained using the ``--list-images`` option for the ``salt-cloud``
  64. command:
  65. .. code-block:: bash
  66. # salt-cloud --list-images my-aliyun-config
  67. my-aliyun-config:
  68. ----------
  69. aliyun:
  70. ----------
  71. centos5u8_64_20G_aliaegis_20131231.vhd:
  72. ----------
  73. Architecture:
  74. x86_64
  75. Description:
  76. ImageId:
  77. centos5u8_64_20G_aliaegis_20131231.vhd
  78. ImageName:
  79. CentOS 5.8 64位
  80. ImageOwnerAlias:
  81. system
  82. ImageVersion:
  83. 1.0
  84. OSName:
  85. CentOS 5.8 64位
  86. Platform:
  87. CENTOS5
  88. Size:
  89. 20
  90. Visibility:
  91. public
  92. ...SNIP...
  93. Locations can be obtained using the ``--list-locations`` option for the ``salt-cloud``
  94. command:
  95. .. code-block:: bash
  96. my-aliyun-config:
  97. ----------
  98. aliyun:
  99. ----------
  100. cn-beijing:
  101. ----------
  102. LocalName:
  103. 北京
  104. RegionId:
  105. cn-beijing
  106. cn-hangzhou:
  107. ----------
  108. LocalName:
  109. 杭州
  110. RegionId:
  111. cn-hangzhou
  112. cn-hongkong:
  113. ----------
  114. LocalName:
  115. 香港
  116. RegionId:
  117. cn-hongkong
  118. cn-qingdao:
  119. ----------
  120. LocalName:
  121. 青岛
  122. RegionId:
  123. cn-qingdao
  124. Security Group can be obtained using the ``-f list_securitygroup`` option
  125. for the ``salt-cloud`` command:
  126. .. code-block:: bash
  127. # salt-cloud --location=cn-qingdao -f list_securitygroup my-aliyun-config
  128. my-aliyun-config:
  129. ----------
  130. aliyun:
  131. ----------
  132. G1989096784427999:
  133. ----------
  134. Description:
  135. G1989096784427999
  136. SecurityGroupId:
  137. G1989096784427999
  138. .. note::
  139. Aliyun ECS REST API documentation is available from `Aliyun ECS API <http://help.aliyun.com/list/11113464.html?spm=5176.7224429.1997282881.55.J9XhVL>`_.