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: docs/guides/virtualization/cloud-init/01_fundamentals.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,15 +1,15 @@
1
1
---
2
2
title: 1. cloud-init fundamentals
3
3
author: Wale Soyinka
4
-
contributors: Steven Spencer
4
+
contributors: Steven Spencer, Ganna Zhyrnova
5
5
tags:
6
6
- cloud-init
7
7
- cloud
8
8
- automation
9
9
---
10
10
11
11
12
-
## The architecture of first boot
12
+
## The architecture of the first boot
13
13
14
14
This guide explores `cloud-init`, the essential tool for automating the initial setup of your Rocky Linux 10 cloud instances. When we talk about deploying servers in the cloud—or even in your local virtualization lab—we often take for granted the almost instantaneous transition from a blank image to a fully functional, network-ready machine. This feat of digital alchemy is performed by a single, tireless utility: cloud-init.
15
15
@@ -25,16 +25,16 @@ This is the problem **cloud-init** solves.
25
25
26
26
### What is cloud-init
27
27
28
-
Simply put, cloud-init is the industry-standard multi-distribution package that handles early initialization of cloud instances. It is the core service responsible for taking a generic image (such as the one we are using) and performing the required configuration tasks to transform it into a unique, production-ready server.
28
+
Simply put, Cloud-Init is the industry-standard multi-distribution package that handles early initialization of cloud instances. It is the core service responsible for taking a generic image (such as the one we are using) and performing the required configuration tasks to transform it into a unique, production-ready server.
29
29
30
30
It literally sits at the heart of the provisioning process, interpreting **metadata** and **user-defined instructions** to set up the system. Without it, your cloud instance is just a beautifully compiled Linux kernel with an identity crisis.
31
31
32
32
### The cloud-init ecosystem
33
33
34
-
cloud-init is a consumer, not a creator. It relies on the underlying cloud platform (AWS, Azure, GCP, OpenStack, or local tools such as libvirt) to provide it with configuration information.
34
+
Cloud-init is a consumer, not a creator. It relies on the underlying cloud platform (AWS, Azure, GCP, OpenStack, or local tools such as libvirt) to provide it with configuration information.
35
35
36
36
***Cloud Providers** expose data via a specialized *data source* (often a local HTTP endpoint, a specific disk label, or a kernel parameter).
37
-
***cloud-init** detects this data source, reads the configuration, and executes the appropriate configuration steps.
37
+
***Cloud-init** detects this data source, reads the configuration, and executes the appropriate configuration steps.
38
38
39
39
This decoupling—where the image is generic and the configuration is provided externally—is the fundamental genius of the entire cloud deployment model.
40
40
@@ -44,7 +44,7 @@ For this guide, we will be using the official [Rocky-10-GenericCloud-Base.latest
44
44
45
45
### The target image: A pre-wired workhorse
46
46
47
-
This image is special because it includes the cloud-init package pre-installed and enabled. It has been *generalized*, meaning all machine-specific identifiers, SSH host keys, and log files are all stripped out. It is ready to receive its new identity on first boot.
47
+
This image is special because it includes the cloud-init package pre-installed and enabled. It has been *generalized*, meaning all machine-specific identifiers, SSH host keys, and log files are stripped out. It is ready to receive its new identity on first boot.
48
48
49
49
!!! warning "Use the Recommended Image"
50
50
@@ -71,20 +71,20 @@ We will focus primarily on crafting effective **User-Data** files, which typical
71
71
72
72
## 3. The life cycle: cloud-init's four stages of initialization
73
73
74
-
cloud-init doesn't just run a script and exit; it executes a series of highly structured stages that align with the server's boot process. This methodical approach ensures that dependencies are met (e.g., networking is configured before packages are downloaded).
74
+
Cloud-init doesn't just run a script and exit; it executes a series of highly structured stages that align with the server's boot process. This methodical approach ensures that dependencies are met (e.g., networking is configured before packages are downloaded).
75
75
76
76
Understanding this life cycle is crucial for debugging and knowing precisely when your custom instructions are executed.
|**Generator**| Runs very early in the boot process. Sets up internal directories and performs basic configuration checks. | Internal setup, log initialisation. |
81
-
|**Local**| Runs before the network is necessarily up. It processes local data sources like CD-ROM or virtual drives (which we'll use in our lab). | Setting hostname from local data, initial disk setup. |
81
+
|**Local**| Runs before the network is necessarily up. It processes local data sources, such as CD-ROMs or virtual drives (which we'll use in our lab). | Setting hostname from local data, initial disk setup. |
82
82
|**Network**| Runs once networking is fully configured and operational. It queries network-based data sources (like the cloud provider's API). | Configure network interfaces, fetch keys from network metadata. |
83
-
|**Final**| Runs last. This is where the majority of user-defined configuration takes place, as all prerequisites (users, network, disks) are now ready. | Installing packages, running custom scripts (runcmd), writing files (write_files), system clean-up. |
83
+
|**Final**| Runs last. This is where the majority of user-defined configuration takes place, as all prerequisites (users, network, disks) are now ready. | Installing packages, running custom scripts (runcmd), writing files (write_files), and system clean-up. |
84
84
85
85
!!! tip "Check the logs"
86
86
87
-
When troubleshooting, always check `/var/log/cloud-init.log`. This file is the forensic report of the `cloud-init` process, showing exactly when each stage began and finished, and what modules were executed along the way. If your script didn't run, the log will tell you exactly why, and which stage failed.
87
+
When troubleshooting, always check `/var/log/cloud-init.log`. This file is the forensic report for the `cloud-init` process, showing exactly when each stage began and ended, and which modules were executed along the way. If your script didn't run, the log will tell you exactly why and which stage failed.
0 commit comments