Lab 02: Cloud-Init Basics
Customize first boot settings and verify them from inside the VM.
You will learn:
- how
hostnamebecomes the guest hostname - how
usercontrols the Linux login user - how
sudochanges privilege behavior - why cloud-init runs before Yeast provisioning
- where cloud-init stops and provisioning begins
What You Will Build
Before You Start
Run:
You should already understand the basic loop from Lab 01.
Step 1: Create The Project
Replace yeast.yaml with:
version: 1
instances:
- name: web
hostname: cloudinit-lab
image: ubuntu-24.04
memory: 1024
cpus: 1
disk_size: 20G
user: yeast
sudo: nopasswd
Step 2: Start The VM
Cloud-init runs during the guest's first boot. It prepares the hostname, user, SSH access, and sudo policy before Yeast can connect for guest operations.
Step 3: Verify The Hostname
Expected output:
Step 4: Verify The User
Expected output:
Step 5: Verify Sudo Policy
The command should exit successfully because sudo: nopasswd allows passwordless sudo for this lab.
Step 6: Inspect The VM
Use inspect when you want detailed state for one instance.
Clean Up
What You Learned
Cloud-init is the first-boot setup layer. Yeast uses it to make the VM reachable and usable.
Provisioning is different: provisioning happens after SSH is ready. You will use that next.
Next Lab
Continue with Provisioning After Boot.