Skip to content

Commit 51dfdee

Browse files
[Update] Overview of the Metadata Service (linode#6600)
Updated cloud-init distro support screenshot, added more info for Base64 command
1 parent 47d4cd4 commit 51dfdee

File tree

3 files changed

+22
-13
lines changed

3 files changed

+22
-13
lines changed
Loading

docs/products/compute/compute-instances/guides/metadata/index.md

+22-13
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: "Overview of the Metadata Service"
33
description: "Learn how to automate server provisioning on the Linode platform through the new Metadata service and cloud-init."
44
keywords: ["user data", "metadata", "cloud-init", "cloudinit"]
55
published: 2023-07-25
6-
modified: 2023-08-29
6+
modified: 2023-09-11
77
modified_by:
88
name: Linode
99
authors: ["Linode"]
@@ -37,9 +37,9 @@ Akamai's Metadata service is available in beta and limited to select data center
3737
- **Data centers:** Washington, DC (`us-iad`) and Paris (`fr-par`)
3838
- **Distributions:** Ubuntu 22.04 LTS and Ubuntu 20.04 LTS
3939

40-
Additional regions and distributions may be added throughout the beta period. When selecting a distribution in the Cloud Manager, the following icon designates distributions that *do not* yet have cloud-init support:
40+
Additional regions and distributions may be added throughout the beta period. When selecting a distribution in the Cloud Manager, the following icon designates distributions that fully support the Metadata service:
4141

42-
![Icon that means a distribution does not support user data and cloud-init](cloud-init-not-supported.png)
42+
![Screenshot showing icon that indicates user data and cloud-init support for a distribution](cloud-init-supported-image.png)
4343

4444
{{< note >}}
4545
Compute Instances deployed in a supported region can always access the [Metadata Service API](#access-the-metadata-service-api) to obtain instance data, regardless of the distribution. However, user data cannot be submitted for distributions that do not yet have cloud-init support.
@@ -74,11 +74,7 @@ linode-cli linodes create \
7474
--metadata.user_data [your-user-data]
7575
```
7676

77-
Replace *[your-root-password]* with a strong root password and *[your-user-data]* with the cloud-config data or script you wish to use. When using the API or CLI, user data must be a [base64-encoded string](https://en.wikipedia.org/wiki/Base64). You can output your cloud-config or script file as base64 by running the following command:
78-
79-
```command
80-
cat *[file-path]* | base64
81-
```
77+
Replace *[your-root-password]* with a strong root password and *[your-user-data]* with the cloud-config data or script you wish to use. When using the CLI, user data must be a Base64-encoded string. Review the [Base64 Encoded](#base64-encoded) section below to generate the string.
8278
{{< /tab >}}
8379
{{< tab "Linode API" >}}
8480
Run the API curl request below, making sure to properly paste in or reference your [API token](/docs/products/tools/api/guides/manage-api-tokens/).
@@ -99,11 +95,7 @@ curl -H "Content-Type: application/json" \
9995
https://api.linode.com/v4/linode/instances
10096
```
10197

102-
Replace *[your-root-password]* with a strong root password and *[your-user-data]* with the cloud-config data or script you wish to use. When using the API or CLI, user data must be a [base64-encoded string](https://en.wikipedia.org/wiki/Base64). You can output your cloud-config or script file as base64 by running the following command:
103-
104-
```command
105-
cat *[file-path]* | base64
106-
```
98+
Replace *[your-root-password]* with a strong root password and *[your-user-data]* with the cloud-config data or script you wish to use. When using the API, user data must be a Base64-encoded string. Review the [Base64 Encoded](#base64-encoded) section below to generate the string.
10799
{{< /tab >}}
108100
{{< /tabs >}}
109101

@@ -138,6 +130,23 @@ User data can be provided in many different formats, with the most common being
138130

139131
- **Other formats:** Review the [User data formats](https://cloudinit.readthedocs.io/en/latest/explanation/format.html#user-data-formats) guide within the official documentation to learn more about other types of formats supported by cloud-init.
140132

133+
#### Base64 Encoded
134+
135+
When submitting user data through the Linode CLI or API, you first need to encode it into [Base64](https://en.wikipedia.org/wiki/Base64) (without any line breaks/wraps). To do that, run the command below that corresponds with your local operating system. Replace *[file]* with the name (and path, if needed) of your cloud-config or script file.
136+
137+
{{< tabs >}}
138+
{{< tab "macOS" >}}
139+
```command
140+
base64 --break=0 --input=[file]
141+
```
142+
{{< /tab >}}
143+
{{< tab "Linux" >}}
144+
```command
145+
base64 --wrap=0 [file]
146+
```
147+
{{< /tab >}}
148+
{{< /tabs >}}
149+
141150
## Modify Cloud-Init Configuration and Save a Custom Image {#modify-cloud-init}
142151

143152
Our supported distribution images have cloud-init pre-installed and configured to interact with our Metadata service. Beyond submitting user data, you are not able to adjust cloud-init settings directly through the Cloud Manager, Linode CLI, or Linode API. If you do wish to deploy Compute Instances using a modified cloud-init configuration, you can use our [Images](/docs/products/tools/images/) service.

0 commit comments

Comments
 (0)