2015-06-17 22:41:03 +00:00
===============================
2014-05-24 07:32:50 +00:00
Getting Started With Aliyun ECS
2015-06-17 22:41:03 +00:00
===============================
2014-05-24 07:32:50 +00:00
The Aliyun ECS (Elastic Computer Service) is one of the most popular public
cloud providers in China. This cloud provider can be used to manage aliyun
instance using salt-cloud.
http://www.aliyun.com/
Dependencies
============
This driver requires the Python `` requests `` library to be installed.
Configuration
=============
Using Salt for Aliyun ECS requires aliyun access key id and key secret.
These can be found in the aliyun web interface, in the "User Center" section,
under "My Service" tab.
.. code-block :: yaml
# Note: This example is for /etc/salt/cloud.providers or any file in the
# /etc/salt/cloud.providers.d/ directory.
my-aliyun-config:
# aliyun Access Key ID
2014-05-24 07:38:14 +00:00
id: wDGEwGregedg3435gDgxd
2014-05-24 07:32:50 +00:00
# aliyun Access Key Secret
2014-05-24 07:38:14 +00:00
key: GDd45t43RDBTrkkkg43934t34qT43t4dgegerGEgg
2014-05-24 07:32:50 +00:00
location: cn-qingdao
2015-06-17 22:41:03 +00:00
driver: aliyun
2014-05-24 07:32:50 +00:00
Profiles
========
Cloud Profiles
~~~~~~~~~~~~~~
Set up an initial profile at `` /etc/salt/cloud.profiles `` or in the
`` /etc/salt/cloud.profiles.d/ `` directory:
.. code-block :: yaml
aliyun_centos:
2015-06-17 22:41:03 +00:00
driver: my-aliyun-config
2014-05-24 07:32:50 +00:00
size: ecs.t1.small
location: cn-qingdao
securitygroup: G1989096784427999
image: centos6u3_64_20G_aliaegis_20130816.vhd
Sizes can be obtained using the `` --list-sizes `` option for the `` salt-cloud ``
command:
.. code-block :: bash
# salt-cloud --list-sizes my-aliyun-config
my-aliyun-config:
----------
aliyun:
----------
ecs.c1.large:
----------
CpuCoreCount:
8
InstanceTypeId:
ecs.c1.large
MemorySize:
16.0
...SNIP...
Images can be obtained using the `` --list-images `` option for the `` salt-cloud ``
command:
.. code-block :: bash
# salt-cloud --list-images my-aliyun-config
my-aliyun-config:
----------
aliyun:
----------
centos5u8_64_20G_aliaegis_20131231.vhd:
----------
Architecture:
x86_64
Description:
2014-12-11 15:51:43 +00:00
2014-05-24 07:32:50 +00:00
ImageId:
centos5u8_64_20G_aliaegis_20131231.vhd
ImageName:
CentOS 5.8 64位
ImageOwnerAlias:
system
ImageVersion:
1.0
OSName:
CentOS 5.8 64位
Platform:
CENTOS5
Size:
20
Visibility:
public
...SNIP...
Locations can be obtained using the `` --list-locations `` option for the `` salt-cloud ``
command:
.. code-block :: bash
my-aliyun-config:
----------
aliyun:
----------
cn-beijing:
----------
LocalName:
北京
RegionId:
cn-beijing
cn-hangzhou:
----------
LocalName:
杭州
RegionId:
cn-hangzhou
cn-hongkong:
----------
LocalName:
香港
RegionId:
cn-hongkong
cn-qingdao:
----------
LocalName:
青岛
RegionId:
cn-qingdao
2014-12-11 15:51:43 +00:00
Security Group can be obtained using the `` -f list_securitygroup `` option
2014-05-24 07:32:50 +00:00
for the `` salt-cloud `` command:
.. code-block :: bash
# salt-cloud --location=cn-qingdao -f list_securitygroup my-aliyun-config
my-aliyun-config:
----------
aliyun:
----------
G1989096784427999:
----------
Description:
G1989096784427999
SecurityGroupId:
G1989096784427999
.. note ::
2014-12-11 15:51:43 +00:00
Aliyun ECS REST API documentation is available from `Aliyun ECS API <http://help.aliyun.com/list/11113464.html?spm=5176.7224429.1997282881.55.J9XhVL> `_ .