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.

Filter by
Sorted by
Tagged with
0 votes
0 answers
19 views

Stopping parameter expansion in write_file content of cloud-init userdata

Background I'm using Terraform and cloud-init to provision an Ubuntu VM. The Terraform template contains an embedded cloud-init user_data section that contains a write_file directive to write a bash ...
0 votes
1 answer
137 views

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 ...
0 votes
1 answer
70 views

Change password first Log In sudo su with Cloud-init

I'm trying to implement this rule with cloud init but I can't, I would like the user to have a password entered by me but as soon as he executes the sudo su command, the system forces the user to ...
1 vote
1 answer
95 views

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 ...
0 votes
1 answer
84 views

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-...
  • 4,911
0 votes
0 answers
74 views

Cloud-Init boot takes One Hour+ to start

Hello Everyone, I am looking to understand what process is running that halting the boot up of our ubuntu VM's that was originally configured with cloud-init. The after the entries paint in the ...
  • 1
1 vote
1 answer
3k views

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 ...
  • 52.8k
0 votes
1 answer
56 views

cloud-init: Getting the error: No such function check

I have this configuration, disk_setup: /dev/vdb: table_type: gpt, layout: true fs_setup: - label: repo filesystem: ext4 device: /dev/vdb1 partition: auto This is the error I get, ...
2 votes
0 answers
408 views

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=...
  • 52.8k
1 vote
1 answer
71 views

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....
3 votes
0 answers
702 views

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/...
2 votes
2 answers
799 views

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 ...
4 votes
1 answer
4k views

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 ...
  • 4,911
1 vote
1 answer
321 views

Why are cloud-init processes running long after server creation?

I'm spinning up a new Ubuntu 18.04 cloud server and using a cloud-init to install docker. I can see that the cloud-init process runs and apparently completes fine, by inspecting the /var/log/cloud-...
0 votes
2 answers
253 views

DHCP lease renewal fails on AWS lightsail server

Tuesday the 12th of September 2021 out of the blue a root server of mine running debian hosted in AWS Lightsail crashed. After a reboot it would run fine for approximately 20-60 minutes, after that it ...
1 vote
0 answers
580 views

How can I use cloud-init NoCloud with OPNsense 21?

I'm new to OPNSense (also to FreeBSD in general) and I'm interested to use cloud-init to configure at least LAN (vtnet0) with static ip address, root password and eventually running custom scripts (or ...
2 votes
2 answers
1k views

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: ...
  • 135
1 vote
2 answers
662 views

prevent secrets from being printed to cloud-init logs

A cloud-init script needs to set environment variable values to contain secrets. What specific syntax can be changed in the below to prevent the secret PASS and PSS from being printed in the cloud-...
  • 4,911
0 votes
1 answer
488 views

Unexpected token within environment variable throws syntax error in cloud-init

What specific syntax must be changed in the code below in order to prevent the error that is being thrown when an environment variable contains an unexpected token? THE CODE: Specifically, a cloud-...
  • 4,911
0 votes
0 answers
334 views

Mount NFS drive during automatic installation

I am setting up automatic installation (autoinstall / AutoInstallation) of Ubuntu server 20.04 Focal by booting the USB installer and fetching the user-data configuration file from a local http server....
  • 3
0 votes
2 answers
443 views

Is there a way to capture/log installations and installation errors caused by the tasksel?

I have an automation script that involves this line: :~$ sudo tasksel install desktop-xfce meta-top10 meta-default tasksel: apt-get failed (100) But I am unsure why tasksel failed. Is there a way to ...
  • 1,171
1 vote
3 answers
3k views

Changing default values in /etc/ssh/sshd_config using cloud init config

My Ubuntu18 VMs come up with the following default config in /etc/ssh/sshd_config upon deployment, which makes my ssh sessions into them terminate upon 5min inactivity: ClientAliveInterval 300 ...
0 votes
0 answers
844 views

Obscuring password in cloud-init userdata startup of AWS EC2 instance

An AWS EC2 instance creates a new user during its cloud-init startup process, and sets the password for that new user. Terraform is being used to trigger the creation of the new EC2 instance, which ...
  • 4,911
0 votes
2 answers
2k views

How do I use Hashicorp's Linux Repository with Centos 8 and cloud-init to install Vault

How do I use Hashicorp's Linux Repository with Centos 8 and cloud-init to install vault? I have tried this cloud-config file without success: #cloud-config package_update: true packages: - jq - ...
1 vote
1 answer
1k views

Make Python3 default without breaking yum in RHEL7

What specific syntax needs to be changed or added to the below in order for commands calling python in a RHEL7 VM to be interpreted using Python3 WITHOUT breaking programs like yum that require ...
  • 4,911
1 vote
2 answers
2k views

Ubuntu Server won't start if no GPU is installed

I try to set my old PC as a headless Ubuntu Server. When I first installed it with a GPU and then removed the GPU everything worked as excepted. My Motherboard (Asus p8p67-m) made one long and three ...
  • 121
3 votes
2 answers
5k views

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 ...
  • 131
3 votes
2 answers
2k views

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 ...
-1 votes
1 answer
3k views

Rename network interface ubuntu on instance boot cloud-init

I have two network interfaces- eth0 and eth1 on the Ubuntu image I am building. I want to create cloud instances from that image. For every cloud instance it creates, every instance will have those ...
0 votes
1 answer
689 views

How to boot after partitioning

I have an ubuntu server. Via cloud-init I make partitions. When I restart my server, it would not come up again. I am sure I miss one command to tell the system which partition should be used for ...
  • 175
2 votes
0 answers
134 views

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 ...
  • 33
1 vote
1 answer
2k views

Order of execution for cloud-init-local on AWS Linux

I am attempting to create a new EC2 instance and I am supplying user-data to the instance at create time. My user-data executes some bash commands that modify the parameters of a properties file for ...
  • 33
2 votes
1 answer
1k views

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: - ...
  • 141
90 votes
9 answers
101k views

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, ...