Questions tagged [cloud-init]

**cloud-init** is a tool that handles initialization and configuration of cloud instances. It is installed in many Cloud Images used on major clouds and supports various Linux distributions (as well as a couple of the BSDs). Some higher level tools, such as Terraform, use it.

cloud-init is a tool that handles initialization and configuration of cloud instances. It is installed in many Cloud Images used on major clouds and supports various Linux distributions (as well as a couple of the BSDs). Some higher level tools, such as Terraform, use it.

For more information, see the official documentation and the project repo.

35 questions
90
votes
9 answers

How to disable `apt-daily.service` on Ubuntu cloud VM image?

The Ubuntu 16.04 server VM image apparently starts the "apt-daily.service" every 12 hours or so; this service performs various APT-related tasks like refreshing the list of available packages, performing unattended upgrades if needed, etc. When…
Riccardo Murri
  • 16,238
  • 4
  • 56
  • 46
4
votes
1 answer

Errors during downloading metadata for repository 'epel'

What specific syntax must be changed in the cloud-init startup script excerpt below in order to handle the error message shown below by retrying something else until it correctly works without throwing an error? Command That triggers Error: The…
CodeMed
  • 5,079
  • 45
  • 100
  • 147
3
votes
0 answers

ubuntu-server PXE cloud-init autoinstall not automatic

I'm trying to automatically install ubuntu-server 21.10 via PXE. Since the text-based installation does work, I omit some details about the whole PXE setup. This is the relevant part of /srv/tftp/pxelinux.cfg/default: label 1 menu label ^Install…
a.ilchinger
  • 141
  • 2
3
votes
2 answers

Azure VM cloud-init overrides /etc/fstab

I added an additional data disk, as described in the Attach a data disk to a Linux VM documentation. The partition in question is /dev/sdc1. I added this line to the very bottom. Unfortunately the cloud-init magic works its wonders in a bad way and…
lapsus
  • 131
  • 1
  • 4
3
votes
2 answers

When using cloud-init, what order are the users created in?

I am using cloud-init to initialize a RHEL Atomic Host VM. I have the following as my user-data file: #cloud-config groups: - ourgroup users: - name: muser primary_group: ourgroup lock_passwd: false sudo: ALL=(ALL) NOPASSWD:ALL …
pacoverflow
  • 278
  • 3
  • 15
2
votes
1 answer

cloud-init does not work for Ubuntu 22.04 images

I'm testing cloud-init for Ubuntu 22.04 images, So I first downloaded the cloud image from: https://cloud-images.ubuntu.com/releases/22.04/release/ubuntu-22.04-server-cloudimg-amd64.img Then I create a simple configuration: cat > meta-data <<…
daisy
  • 53,527
  • 78
  • 236
  • 383
2
votes
0 answers

Can't boot arm64 cloud image with qemu

I first downloaded ubuntu-22.04-server-cloudimg-arm64.img, then I started it with qemu qemu-system-aarch64 -m 2G -M virt -cpu max -bios /usr/share/qemu-efi-aarch64/QEMU_EFI.fd -drive if=none,file=ubuntu-22.04-server-cloudimg-arm64.img,id=hd0 -device…
daisy
  • 53,527
  • 78
  • 236
  • 383
2
votes
2 answers

cloud-init.log shows write_files.0: Additional properties are not allowed ('defer' was unexpected)

I have a very simply stansa in my cloud-init, write_files: - path: /home/ecarroll/.zshrc content: | source ~/powerlevel10k/powerlevel10k.zsh-theme owner: ecarroll:ecarroll permissions: '0644' defer: true The defer flag is…
Evan Carroll
  • 28,578
  • 45
  • 164
  • 290
2
votes
2 answers

Debian 11 fails to set IPv6 via Cloud-Init: "ens18/disable_ipv6: No such file or directory"

When using Cloud-Init to set both a static IPv4 and IPv6 in the latest Debian 11 (generic) cloud image, networking.service throws the following error at boot: Aug 16 14:28:29 debian ifup[540]: sysctl: cannot stat…
miho
  • 145
  • 1
  • 9
2
votes
0 answers

Using cloud-init to modify application properties used by init scripts

I previously asked this question about ordering of init scripts. It turns out that this isn't the solution I need (or possibly even the correct question to ask) - it was phantom success. My system is an AWS EC2 instance, running upstart(init) 0.6.5…
ben_979
  • 33
  • 4
2
votes
1 answer

How to setup MySQL with cloud-init?

How can I do this? #cloud-config users: - name: dev ssh-authorized-keys: - ssh-rsa AB3NzaC1yc... sudo: ['ALL=(ALL) NOPASSWD:ALL'] groups: sudo shell: /bin/bash packages: - mysql-client - libmysqlclient-dev -…
nmdias
  • 141
  • 5
1
vote
1 answer

cloudinit does not run for qemu/kvm systems created by terraform and libvirt provider

I'm trying to provision a VM on qemu/kvm hypervisor using cloudinit with terraform and the libvirt provider. I can get the machine to start, but the cloudinit is not getting kicked off. I know that the user-data being used will work as I've tested…
1
vote
1 answer

Is there an immutable KVM host OS?

My homelab environment is primarily git repo->puppet apply->centos7 hardware running kvm or guests. Simple tooling but it works. I'm doing a lot more terraform at work these days and have been thinking about refreshing my homelab with an…
alan laird
  • 13
  • 3
1
vote
1 answer

secrets unintentionally printed to cloud-init logs

The two lines of bash code below pull a secret into a cloud-init script for an Azure VM running RHEL8. But each of the two lines has an unintended side effect of printing the secret into the cloud-init logs for the entire world to see. What…
CodeMed
  • 5,079
  • 45
  • 100
  • 147
1
vote
1 answer

Why does the cloud-init version in log file conflict with the version in the binary?

Why does head -n 1 /var/log/cloud-init.log show the following, util.py[DEBUG]: Cloud-init v. 21.2-3-g899bfaa9-0ubuntu2~20.04.1 running 'init-local' at Fri, 21 Jan 2022 18:03:44 +0000. Up 48.49 seconds. Indicating clearly it's Cloud-init v. 21.2-3…
Evan Carroll
  • 28,578
  • 45
  • 164
  • 290
1
2 3