summaryrefslogtreecommitdiff
path: root/doc/rtd/reference/datasources/aliyun.rst
blob: 5121f53de30727fb1d1186821a8df7035cb8110f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
.. _datasource_aliyun:

Alibaba Cloud (AliYun)
**********************

The ``AliYun`` datasource reads data from Alibaba Cloud ECS. Support is
present in ``cloud-init`` since 0.7.9.

Metadata service
================

The Alibaba Cloud metadata service is available at the well known URL
:file:`http://100.100.100.200/`. For more information see Alibaba Cloud ECS
on `metadata`_.

Configuration
=============

The following configuration can be set for the datasource in system
configuration (in :file:`/etc/cloud/cloud.cfg` or
:file:`/etc/cloud/cloud.cfg.d/`).

An example configuration with the default values is provided below:

.. code-block:: yaml

   datasource:
     AliYun:
       metadata_urls: ["http://100.100.100.200"]
       timeout: 50
       max_wait: 120

Versions
--------

Like the EC2 metadata service, Alibaba Cloud's metadata service provides
versioned data under specific paths. As of April 2018, there are only
``2016-01-01`` and ``latest`` versions.

It is expected that the dated version will maintain a stable interface but
``latest`` may change content at a future date.

``Cloud-init`` uses the ``2016-01-01`` version.

You can list the versions available to your instance with:

.. code-block:: shell-session

   $ curl http://100.100.100.200/

Example output:

.. code-block::

   2016-01-01
   latest

Metadata
--------

Instance metadata can be queried at
:file:`http://100.100.100.200/2016-01-01/meta-data`:

.. code-block:: shell-session

   $ curl http://100.100.100.200/2016-01-01/meta-data

Example output:

.. code-block::

   dns-conf/
   eipv4
   hostname
   image-id
   instance-id
   instance/
   mac
   network-type
   network/
   ntp-conf/
   owner-account-id
   private-ipv4
   public-keys/
   region-id
   serial-number
   source-address
   sub-private-ipv4-list
   vpc-cidr-block
   vpc-id

Userdata
--------

If provided, user data will appear at
:file:`http://100.100.100.200/2016-01-01/user-data`.
If no user data is provided, this will return a 404.

.. code-block:: shell-session

   $ curl http://100.100.100.200/2016-01-01/user-data

Example output:

.. code-block::

   #!/bin/sh
   echo "Hello World."

.. LINKS
.. _metadata: https://www.alibabacloud.com/help/zh/faq-detail/49122.htm