Merge ~powersj/cloud-init:docs/instancedata into cloud-init:master

Proposed by Joshua Powers
Status: Merged
Approved by: Chad Smith
Approved revision: 41874be7877b3aa35069213546fe310a3e77b544
Merge reported by: Server Team CI bot
Merged at revision: not available
Proposed branch: ~powersj/cloud-init:docs/instancedata
Merge into: cloud-init:master
Diff against target: 240 lines (+127/-67)
1 file modified
doc/rtd/topics/instancedata.rst (+127/-67)
Reviewer Review Type Date Requested Status
Server Team CI bot continuous-integration Approve
Chad Smith Approve
Review via email: mp+372645@code.launchpad.net

Commit message

docs: doc8 fixes for instancedata page

The huge table was scrolling off the page for me and it made more sense
to break this up and have sections for each item anyway.

To post a comment you must log in.
Revision history for this message
Server Team CI bot (server-team-bot) wrote :

PASSED: Continuous integration, rev:e03f2081bb9547ad1fc19dd31f14aff31eb05730
https://jenkins.ubuntu.com/server/job/cloud-init-ci/1131/
Executed test runs:
    SUCCESS: Checkout
    SUCCESS: Unit & Style Tests
    SUCCESS: Ubuntu LTS: Build
    SUCCESS: Ubuntu LTS: Integration
    IN_PROGRESS: Declarative: Post Actions

Click here to trigger a rebuild:
https://jenkins.ubuntu.com/server/job/cloud-init-ci/1131//rebuild

review: Approve (continuous-integration)
Revision history for this message
Chad Smith (chad.smith) wrote :

Thanks Josh! +1

Revision history for this message
Chad Smith (chad.smith) :
review: Approve
Revision history for this message
Server Team CI bot (server-team-bot) wrote :

Autolanding: FAILED
Unapproved changes made after approval.
https://jenkins.ubuntu.com/server/job/cloud-init-autoland-test/336/
Executed test runs:
    SUCCESS: Checkout
    SUCCESS: Unit & Style Tests
    SUCCESS: Ubuntu LTS: Build
    SUCCESS: Ubuntu LTS: Integration
    IN_PROGRESS: Declarative: Post Actions

review: Needs Fixing (continuous-integration)
Revision history for this message
Server Team CI bot (server-team-bot) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/doc/rtd/topics/instancedata.rst b/doc/rtd/topics/instancedata.rst
2index 231a008..c17d0a0 100644
3--- a/doc/rtd/topics/instancedata.rst
4+++ b/doc/rtd/topics/instancedata.rst
5@@ -90,47 +90,107 @@ There are three basic top-level keys:
6
7 The standardized keys present:
8
9-+----------------------+-----------------------------------------------+-----------------------------------+
10-| Key path | Description | Examples |
11-+======================+===============================================+===================================+
12-| v1._beta_keys | List of standardized keys still in 'beta'. | [subplatform] |
13-| | The format, intent or presence of these keys | |
14-| | can change. Do not consider them | |
15-| | production-ready. | |
16-+----------------------+-----------------------------------------------+-----------------------------------+
17-| v1.cloud_name | Where possible this will indicate the 'name' | aws, openstack, azure, |
18-| | of the cloud this system is running on. This | configdrive, nocloud, |
19-| | is specifically different than the 'platform' | ovf, etc. |
20-| | below. As an example, the name of Amazon Web | |
21-| | Services is 'aws' while the platform is 'ec2'.| |
22-| | | |
23-| | If no specific name is determinable or | |
24-| | provided in meta-data, then this field may | |
25-| | contain the same content as 'platform'. | |
26-+----------------------+-----------------------------------------------+-----------------------------------+
27-| v1.instance_id | Unique instance_id allocated by the cloud | i-<somehash> |
28-+----------------------+-----------------------------------------------+-----------------------------------+
29-| v1.local_hostname | The internal or local hostname of the system | ip-10-41-41-70, |
30-| | | <user-provided-hostname> |
31-+----------------------+-----------------------------------------------+-----------------------------------+
32-| v1.platform | An attempt to identify the cloud platform | ec2, openstack, lxd, gce |
33-| | instance that the system is running on. | nocloud, ovf |
34-+----------------------+-----------------------------------------------+-----------------------------------+
35-| v1.subplatform | Additional platform details describing the | metadata (http://168.254.169.254),|
36-| | specific source or type of metadata used. | seed-dir (/path/to/seed-dir/), |
37-| | The format of subplatform will be: | config-disk (/dev/cd0), |
38-| | <subplatform_type> (<url_file_or_dev_path>) | configdrive (/dev/sr0) |
39-+----------------------+-----------------------------------------------+-----------------------------------+
40-| v1.public_ssh_keys | A list of ssh keys provided to the instance | ['ssh-rsa AA...', ...] |
41-| | by the datasource metadata. | |
42-+----------------------+-----------------------------------------------+-----------------------------------+
43-| v1.region | The physical region/datacenter in which the | us-east-2 |
44-| | instance is deployed | |
45-+----------------------+-----------------------------------------------+-----------------------------------+
46-| v1.availability_zone | The physical availability zone in which the | us-east-2b, nova, null |
47-| | instance is deployed | |
48-+----------------------+-----------------------------------------------+-----------------------------------+
49+v1._beta_keys
50+-------------
51+List of standardized keys still in 'beta'. The format, intent or presence of
52+these keys can change. Do not consider them production-ready.
53
54+Example output:
55+
56+- [subplatform]
57+
58+v1.cloud_name
59+-------------
60+Where possible this will indicate the 'name' of the cloud the system is running
61+on. This is different than the 'platform' item. For example, the cloud name of
62+Amazone Web Services is 'aws', while the platform is 'ec2'.
63+
64+If determining a specific name is not possible or provided in meta-data, then
65+this filed may contain the same content as 'platform'.
66+
67+Example output:
68+
69+- aws
70+- openstack
71+- azure
72+- configdrive
73+- nocloud
74+- ovf
75+
76+
77+v1.instance_id
78+--------------
79+Unique instance_id allocated by the cloud.
80+
81+Examples output:
82+
83+- i-<hash>
84+
85+v1.local_hostname
86+-----------------
87+The internal or local hostname of the system.
88+
89+Examples output:
90+
91+- ip-10-41-41-70
92+- <user-provided-hostname>
93+
94+v1.platform
95+-------------
96+An attempt to identify the cloud platfrom instance that the system is running
97+on.
98+
99+Examples output:
100+
101+- ec2
102+- openstack
103+- lxd
104+- gce
105+- nocloud
106+- ovf
107+
108+v1.subplatform
109+--------------
110+Additional platform details describing the specific source or type of metadata
111+used. The format of subplatform will be:
112+
113+``<subplatform_type> (<url_file_or_dev_path>``
114+
115+Examples output:
116+
117+- metadata (http://168.254.169.254)
118+- seed-dir (/path/to/seed-dir/)
119+- config-disk (/dev/cd0)
120+- configdrive (/dev/sr0)
121+
122+v1.public_ssh_keys
123+------------------
124+A list of ssh keys provided to the instance by the datasource metadata.
125+
126+Examples output:
127+
128+- ['ssh-rsa AA...', ...]
129+
130+v1.region
131+---------
132+The physical region/data center in which the instance is deployed.
133+
134+Examples output:
135+
136+- us-east-2
137+
138+v1.availability_zone
139+--------------------
140+The physical availability zone in which the instance is deployed.
141+
142+Examples output:
143+
144+- us-east-2b
145+- nova
146+- null
147+
148+Example Output
149+--------------
150
151 Below is an example of ``/run/cloud-init/instance_data.json`` on an EC2
152 instance:
153@@ -229,28 +289,28 @@ instance:
154 "network": {
155 "interfaces": {
156 "macs": {
157- "06:74:8f:39:cd:a6": {
158- "device-number": "0",
159- "interface-id": "eni-052058bbd7831eaae",
160- "ipv4-associations": {
161- "18.218.221.122": "10.41.41.95"
162- },
163- "local-hostname": "ip-10-41-41-95.us-east-2.compute.internal",
164- "local-ipv4s": "10.41.41.95",
165- "mac": "06:74:8f:39:cd:a6",
166- "owner-id": "437526006925",
167- "public-hostname": "ec2-18-218-221-122.us-east-2.compute.amazonaws.com",
168- "public-ipv4s": "18.218.221.122",
169- "security-group-ids": "sg-828247e9",
170- "security-groups": "Cloud-init integration test secgroup",
171- "subnet-id": "subnet-282f3053",
172- "subnet-ipv4-cidr-block": "10.41.41.0/24",
173- "subnet-ipv6-cidr-blocks": "2600:1f16:b80:ad00::/64",
174- "vpc-id": "vpc-252ef24d",
175- "vpc-ipv4-cidr-block": "10.41.0.0/16",
176- "vpc-ipv4-cidr-blocks": "10.41.0.0/16",
177- "vpc-ipv6-cidr-blocks": "2600:1f16:b80:ad00::/56"
178- }
179+ "06:74:8f:39:cd:a6": {
180+ "device-number": "0",
181+ "interface-id": "eni-052058bbd7831eaae",
182+ "ipv4-associations": {
183+ "18.218.221.122": "10.41.41.95"
184+ },
185+ "local-hostname": "ip-10-41-41-95.us-east-2.compute.internal",
186+ "local-ipv4s": "10.41.41.95",
187+ "mac": "06:74:8f:39:cd:a6",
188+ "owner-id": "437526006925",
189+ "public-hostname": "ec2-18-218-221-122.us-east-2.compute.amazonaws.com",
190+ "public-ipv4s": "18.218.221.122",
191+ "security-group-ids": "sg-828247e9",
192+ "security-groups": "Cloud-init integration test secgroup",
193+ "subnet-id": "subnet-282f3053",
194+ "subnet-ipv4-cidr-block": "10.41.41.0/24",
195+ "subnet-ipv6-cidr-blocks": "2600:1f16:b80:ad00::/64",
196+ "vpc-id": "vpc-252ef24d",
197+ "vpc-ipv4-cidr-block": "10.41.0.0/16",
198+ "vpc-ipv4-cidr-blocks": "10.41.0.0/16",
199+ "vpc-ipv6-cidr-blocks": "2600:1f16:b80:ad00::/56"
200+ }
201 }
202 }
203 },
204@@ -319,16 +379,16 @@ user.
205
206 Below are some examples of providing these types of user-data:
207
208-* Cloud config calling home with the ec2 public hostname and avaliability-zone
209+* Cloud config calling home with the ec2 public hostname and availability-zone
210
211-.. code-block:: shell-session
212+.. code-block:: yaml
213
214 ## template: jinja
215 #cloud-config
216 runcmd:
217 - echo 'EC2 public hostname allocated to instance: {{
218 ds.meta_data.public_hostname }}' > /tmp/instance_metadata
219- - echo 'EC2 avaiability zone: {{ v1.availability_zone }}' >>
220+ - echo 'EC2 availability zone: {{ v1.availability_zone }}' >>
221 /tmp/instance_metadata
222 - curl -X POST -d '{"hostname": "{{ds.meta_data.public_hostname }}",
223 "availability-zone": "{{ v1.availability_zone }}"}'
224@@ -336,7 +396,7 @@ Below are some examples of providing these types of user-data:
225
226 * Custom user-data script performing different operations based on region
227
228-.. code-block:: shell-session
229+.. code-block:: jinja
230
231 ## template: jinja
232 #!/bin/bash
233@@ -352,7 +412,7 @@ Below are some examples of providing these types of user-data:
234 and the following string in your rendered user-data:
235 ``CI_MISSING_JINJA_VAR/<your_varname>``.
236
237-Cloud-init also surfaces a commandline tool **cloud-init query** which can
238+Cloud-init also surfaces a command line tool **cloud-init query** which can
239 assist developers or scripts with obtaining instance metadata easily. See
240 :ref:`cli_query` for more information.
241

Subscribers

People subscribed via source and target branches