You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/articles/cloud-init/bare-metal-after-boot.md
+21-5Lines changed: 21 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,13 @@ This article shows how to manually invoke cloud-init on an on-premises machine (
12
12
13
13
This article is a *starting point*. We'll provide the necessary cloud-init data using a standard HTTP server. You can later add features like HTTPS and dynamic data if needed.
14
14
15
+
> [!WARNING]
16
+
> Cloud-init usually works, but it can sometimes be tricky and frustrating to use.
17
+
>
18
+
> For example, it may hang or fail to detect the datasource, and troubleshooting these issues - especially when the datasource isn't picked up - can be very difficult.
19
+
>
20
+
> This is likely because cloud-init was not designed to run after the system has already booted. So keep in mind: it may work, or it may not.
21
+
15
22
## The Datasource
16
23
17
24
The **datasource** specifies what cloud-init should do.
The first command (`cloud-init clean`) resets cloud-init so it behaves as if it has never run.
152
160
161
+
After that, we force cloud-init to [detect the datasource](https://cloudinit.readthedocs.io/en/latest/howto/identify_datasource.html) from the config. This command is sometimes necessary (for unknown reasons).
162
+
153
163
The next three commands execute the [three cloud-init stages](https://cloudinit.readthedocs.io/en/latest/explanation/boot.html): `init`, `config`, and `final`.
154
164
155
165
The last command ensures cloud-init [doesn't run again](https://cloudinit.readthedocs.io/en/latest/howto/disable_cloud_init.html) the next time the system is rebooted.
@@ -181,3 +191,9 @@ cloud-init status --long
181
191
less /var/log/cloud-init.log
182
192
less /var/log/cloud-init-output.log
183
193
```
194
+
195
+
## Full Example
196
+
197
+
I have created a working example that uses the information of this article. You can find it on GitHub:
0 commit comments