File: cloudstack.rst

package info (click to toggle)
cloud-init 25.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 12,412 kB
  • sloc: python: 135,894; sh: 3,883; makefile: 141; javascript: 30; xml: 22
file content (66 lines) | stat: -rw-r--r-- 2,045 bytes parent folder | download | duplicates (3)
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
.. _datasource_cloudstack:

CloudStack
**********

`Apache CloudStack`_ exposes user-data, meta-data, user password, and account
SSH key through the ``virtual router``. The datasource obtains the ``virtual
router`` address via DHCP lease information given to the instance.
For more details on meta-data and user-data, refer to the
`CloudStack Administrator Guide`_.

The following URLs provide to access user-data and meta-data from the Virtual
Machine. ``data-server.`` is a well-known hostname provided by the CloudStack
``virtual router`` that points to the next ``UserData`` server (which is
usually also the ``virtual router``).

.. code-block:: bash

    http://data-server./latest/user-data
    http://data-server./latest/meta-data
    http://data-server./latest/meta-data/{meta-data type}

If ``data-server.`` cannot be resolved, ``cloud-init`` will try to obtain the
``virtual router``'s address from the system's DHCP leases. If that fails,
it will use the system's default gateway.

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/`).

The settings that may be configured are:

* :command:`max_wait`

  The maximum amount of clock time in seconds that should be spent searching
  ``metadata_urls``. A value less than zero will result in only one request
  being made, to the first in the list.

  Default: 120

* :command:`timeout`

  The timeout value provided to ``urlopen`` for each individual http request.
  This is used both when selecting a ``metadata_url`` and when crawling
  the instance metadata service.

  Default: 50

Example
-------

An example configuration with the default values is provided below:

.. code-block:: yaml

   datasource:
     CloudStack:
       max_wait: 120
       timeout: 50


.. _Apache CloudStack: http://cloudstack.apache.org/
.. _CloudStack Administrator Guide: https://docs.cloudstack.apache.org/en/latest/adminguide/virtual_machines.html#user-data-and-meta-data