Questions tagged [cloud-init]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
30 views

ssh login to KVM guest created with cloud-init fails with 'Permission denied (publickey).'

My cloud-init user-data.yaml contains the id_rsa.pub from my desktop system. user-data.yaml looks like this: #cloud-config users: - name: bob ssh_authorized_keys: - ssh-rsa ...
mr.zog's user avatar
  • 942
0 votes
1 answer
29 views

systemd wait for Env variable from external to trigger service start

I have a VM which I'm controlling the boot up process via systemd and cloud-init. For cloud-init I have a script that performs initialization as follows: runcmd: - /etc/systemd/system/init.sh /etc/...
John Hopkins's user avatar
0 votes
1 answer
171 views

Set environment variable for runcmd

Using cloud-init, I can specify a runcmd section and do something like this: runcmd: [ 'MYVAR=VALUE some-command --a A --b B' ] This works, and runs some-command with MYVAR set to VALUE in the ...
Brad's user avatar
  • 1,427
0 votes
0 answers
22 views

Is it possible to use cloud-init without touching the TFTP config and without a dedicated volume?

We are currently deploying bare-metal machines using Kickstart scripts. Therefore, I believe we cannot use dedicated volumes labelled "CIDATA". For reasons specific outside the scope of this ...
E. Jaep's user avatar
  • 293
0 votes
0 answers
178 views

How do I remove cloud-init backing image from my VM?

I am moving a VM from Ubuntu 22.04.3 LTS KVM host to a RHEL 8.9 Ootpa KVM host. When I try to start the VM on the destination (RHEL) host I see, error: Cannot access backing file '/var/iso/jammy-...
mr.zog's user avatar
  • 942
0 votes
1 answer
289 views

Cloud Init can't create Apt source from k8s.io due to 302 redirect

I'm attempting to add the k8s.io apt package source to a VM using cloud-init, but the URL provided from the docs does a 302 redirect, and gpg doesn't like that. cloud-init config.yml: apt: ...
John Manko's user avatar
0 votes
0 answers
263 views

Cloud Init isn't adding Apt sources BEFORE apt update is executed

I'm trying to install packages from docker and k8s.io, but package_update: true isn't using the newly added sources, and finding those packages fails. Here is part of the cloud-init config: apt: ...
John Manko's user avatar
1 vote
1 answer
113 views

cloud-init queries DHCP

We are running a preseeded Ubuntu installation from disk using ubuntu autoinstall (https://ubuntu.com/server/docs/install/autoinstall) Since upgrading to 20.04.6, we are facing issues when the cloud-...
Fang's user avatar
  • 199
1 vote
0 answers
460 views

Overwriting provider DNS via cloud-init

I want to overrides the DNS given by my cloud provider with my own custom DNS entries. This is a Ubuntu instance so this is configured in netplan. Once my VM boots I can see the following at /etc/...
Eric Anderson's user avatar
0 votes
1 answer
211 views

How to route two DHCP interfaces to two different networks

I use LXD and cloud-init to configure an instance with two interfaces which get assigned IP's via DHCP. eth0 (10.23.44.177/24) which is connected to a bridge on the host machine (lxdbr0) to get out ...
Ender's user avatar
  • 103
0 votes
0 answers
345 views

Disable a systemd service before start using cloud-init

I want to disable a service before systemd executes it using cloud-init. I've tried with runcmd but it doesn't work even if logs of the execution are availble. runcmd: - 'systemctl disable docker' ...
lifeisfoo's user avatar
  • 101
0 votes
0 answers
313 views

RedHat 8 and cloud-init not running userdata until new VM is rebooted

I have a Terraform script that is cloning a RedHat 8 VM on vSphere V7. The VM is successfully cloned, but the user in my userdata is not created when the VM starts. If I reboot the VM after it is ...
PrestonDocks's user avatar
0 votes
0 answers
93 views

OpenSUSE MicroOS fails to start on OpenStack

I'm testing some operating systems cloud images to be used on OpenStack. I'm trying OpenSUSE MicroOS with the following butane configuration: --- variant: fcos version: 1.1.0 storage: filesystems: ...
sctx's user avatar
  • 33
0 votes
0 answers
837 views

Amazon Linux 2023 systemd dependencies on cloud-init: Getting ordering cycle

I have a templated systemd service that depends on cloud-init to be done on Amazon Linux 2023. [Unit] Description=My service After=cloud-init.target [Service] Type=exec EnvironmentFile=/local/...
MikeJansen's user avatar
0 votes
1 answer
1k views

Cloud-init in kvm guests (Debian and Centos) not setting interface settings

Im trying to use cloud-init to setup kvm guests (currently Debian 11 and CentOS Stream 8), and I am looking for help in correcting the meta-data and user-data files. Everything else seems to work, but ...
Unpossible's user avatar
2 votes
1 answer
3k views

cloud-init ignores staitc networking configuration

I am performing these steps on Ubuntu 22.04 host: Download the cloud image qemu-img create -b ../jammy-server-cloudimg-amd64.img -f qcow2 -F qcow2 myubuntu2204test01-base.img 10G Create the file meta-...
Sudheer Satyanarayana's user avatar
0 votes
2 answers
27 views

metada conflict when deploying Openstack on GCP

We ran an openstack environnement on GCP with an arch of 1control_1compute_2ceph. When creating VM on openstack, the VM can't initialte the cloud-init, because wit reaches the metadata of GCP instead ...
fsidiosidi's user avatar
0 votes
1 answer
649 views

Cloud-init installing packages on Debian with contrib sources

I need to install some zfs packages on Debian instances using cloud-init. One of the packages needs the contrib sources. I can get it to update the sources list, but the packages fail to install. If ...
dj423's user avatar
  • 23
1 vote
2 answers
4k views

What is the difference between Cloud-Init and Autoinstall?

So I have been trying to essentially install Nixos from the official site with a Cloud-Init for Ubuntu Server 22.04. I want to really understand how to install packages that I potentially might have ...
Definity's user avatar
  • 137
0 votes
1 answer
157 views

multipass cloud-init.yaml ssh asks for password

I am trying to get ssh working in multipass, so I can ssh user@ip -i key.pub not using multipass shell. I am using the following cloud-init: ssh-keygen -C vmadmin -f user_key users: - default - ...
Chris G.'s user avatar
  • 227
0 votes
0 answers
846 views

Creating and mounting a disk using cloud-init after a server is installed

Is it actually possible to run cloud-init to create a disk after the VM itself has been created? I have a VM created on a VMware platform. Currently cloud-init is not enabled on the GUI for creating ...
fooquency's user avatar
  • 147
6 votes
3 answers
5k views

Why the RHEL8 system do not generate SSH host keys automatically when missing?

On the RHEL 8 and previous it is usual, that the SSH host keys in /etc/ssh are generated automatically by sshd service when missing. Usually there should be: /etc/ssh/ssh_host_ecdsa_key /etc/ssh/...
Jaroslav Kucera's user avatar
0 votes
0 answers
1k views

Ubuntu 22.04.1 autoinstall cloud-config fails

I'm currently having an issue installing Ubuntu 22.04 via cloud-init. The server has two hard drives. There should be a /data partition on the second hard disk, but currently, the installation doesn't ...
Dominik Maier's user avatar
1 vote
1 answer
835 views

Cloud Init not working on Vultr

I am new with Cloud-Init, I am trying to install tailscale and Docker with it, and some other packages I tried several times and no luck and no error logs. What I am doing wrong? Here is my script: #...
Rodrigo's user avatar
  • 55
1 vote
1 answer
1k views

Password of new user with LXD and Cloud-init

I'm trying to create a profile to automate the creation of a container, but I'm having trouble with cloud-init. For some reason the password is not being set for the user and is also not being added ...
Matheus Saraiva's user avatar
0 votes
1 answer
864 views

back up and restore host ssh_keys using cloud init autoinstall ubuntu

I am trying to automate VM installations for ubuntu 22.04 using autoinstall,cloud-init, qcow2 and virt-install. When I am reinstalling the OS on the same qcow2 file, I have a script that is run in ...
mavenHawk's user avatar
1 vote
0 answers
446 views

rhel - cloud-init changes SSH config

We want to use cloud-init to resize the rootfs in our pipeline. The resize itself works fine, but it seems like the default cloud-init config (/etc/cloud.cfg) changes also other settings like SSH for ...
MSC's user avatar
  • 11
0 votes
1 answer
984 views

Cloud-init / cloud-config to install node.js

From reading the cloud-init docs (https://cloudinit.readthedocs.io/en/latest/topics/modules.html#apt-configure), it appears that this user-data should add the Nodesource source and key for apt, and ...
Doug Reeder's user avatar
0 votes
0 answers
730 views

My cloud config template file does not seem to be working when I use it to boot up a droplet in Digital Ocean?

I'm using Terraform to spin up a DO droplet, using an Ubuntu and Docker image. Checkout below: resource "digitalocean_droplet" "web" { image = "docker-20-04" name ...
yung peso's user avatar
  • 101
-3 votes
1 answer
347 views

What is the simplest data source for a cloud-init home lab?

I'm using cloud-init 22.1-14 to spin up VMs using Ubuntu cloud images and kvm/qemu on a home server. I think I'm at the stage where I need to implement a data source because my VM creation dies if I ...
mr.zog's user avatar
  • 942
1 vote
1 answer
2k views

Debian 11 dpkg-reconfigure cloud-init does not run the graphical menu

I'm trying to run dpkg-reconfigure cloud-init on Debian 11 After I run the command, this shows up multiple times in the terminal: perl: warning: Please check that your locale settings: LANGUAGE = (...
Philip Scot's user avatar
1 vote
1 answer
1k views

Why would cloudinit resort to using iid-datasource-none?

Had my ssh host key reset by GCE. Found /var/lib/cloud/instances/iid-datasource-none was created. https://cloudinit.readthedocs.io/en/latest/topics/datasources/fallback.html?highlight=iid-datasource-...
user1133275's user avatar
1 vote
0 answers
1k views

Not able to setup administrator password with cloudbase-init

i try to install a windows server 2019 with cloudbase-init. I did the following steps to do this: Install a Windows Server 2019 with Desktop Experience Install Cloudbase-Init Added the following ...
David Koenig's user avatar
6 votes
1 answer
11k views

How to ensure Cloud-Init runs exactly once and once only?

As far as I can see, cloud-init runs every time the config changes. Not just the very first time the system boots, but every time the provided configuration changes. This makes somewhat sense, as I ...
miho's user avatar
  • 252
2 votes
2 answers
3k views

Openstack ubuntuVM SSH public key Permission denied on first boot

I am deploying Openstack(I tried victoria and ussuri) with kolla-ansible on 3 CentOS 8 Nodes (1=Control+Compute,2 and 3=Compute). Deployments works fine without any problems but when I create a new VM ...
Michael's user avatar
  • 21
0 votes
1 answer
2k views

cloud-init seems to be ignoring write-files script

H! I am trying to configure VMs with cloud-init, using the terraform Libvirt provider. For some reason I don't understand, setting hostname works, but writing and running a script for additional ...
Unpossible's user avatar
4 votes
2 answers
17k views

run a script via cloud-init

I know cloud-init allows to run commands as part of the cloud-init yml runcmd: - [ pwd ] but I am looking for a way to execute a full shell script. Some people just pipe the output of a curl into a ...
tcurdt's user avatar
  • 413
0 votes
1 answer
568 views

Cloud-init expire true issue

After add expire: true in the cloud-init script, I can log in via key to the server, but it says You must change your password now and login again! I want if I set the password, the password expires ...
Morteza Soltani's user avatar
0 votes
0 answers
1k views

cloud-init userdata/metadata not loaded in ESXi

I'm using Terraform to provision virtual machines in an ESXi environment. I do this by having once manually imported the Ubuntu Focal Cloud Image as template and cloning virtual machines from it, with ...
user1933738's user avatar
0 votes
1 answer
965 views

All Linux VMs on Azure won't boot, stuck on cloud-init (metadata service crawler) initialization

I have around 5 VMs in Azure, which were originally provisioned as Ubuntu 18 and since then I've been dist-upgrading them several times. A few months ago I noticed that similar VMs on different ...
Maxim V. Pavlov's user avatar
1 vote
3 answers
3k views

How do I download and install a regular DPKG package in a cloud-init script?

I'm spinning up lightweight containers on a Linux Host using LXD/LXC. The sole purpose of these containers is to host "Dotnet & Dotnet core apps" For a while I've been using Ansible, but ...
shawty's user avatar
  • 303
2 votes
1 answer
2k views

Cloud-init for ubuntu-20.04-server-cloudimg works but not ubuntu-20.04-minimal-cloudimg-amd64

So I'm trying to use cloud-init with minimal image ( https://cloud-images.ubuntu.com/minimal/releases/focal/release/ubuntu-20.04-minimal-cloudimg-amd64.img ) but it does not seem to work at all. The ...
Andrew's user avatar
  • 21
1 vote
0 answers
341 views

While creating instances, Cloud-init stops before creating the SSH keys

We have OpenStack v2.3.1, Mitaka with KVM installed on our cluster. While creating instances, the VMs are created successfully every time. However, Cloud-init randomly stops before creating SSH keys ...
ePezhman's user avatar
1 vote
1 answer
2k views

Mount Azure virtual hard disks on filesystem during Azure Linux VM creation using Terraform

I am using Terraform to automate VM creation on Microsoft Azure. The Terraform script shall accept data disk configuration as below (refer data_disk_size_gb), create the virtual hard disk and ...
zaidwaqi's user avatar
  • 153
0 votes
1 answer
533 views

How to create a new user correctly in a debian instance?

I am using ready-made images of debian in the qcow2 format. The default user is "debian". I want to create another user via openstack-horizon. So I elaborated the following script: #cloud-...
campos's user avatar
  • 115
0 votes
1 answer
2k views

Ubuntu Cloud-init User cant login

I have created an ISO to mount to a prepped Ubuntu template, so when it deploys and boots the first time, Cloud init adds some users and do a few commands. Everything seems to work fine as far as i ...
Foxdemon's user avatar
3 votes
6 answers
8k views

Debian 10 cloud-init waiting for DHCP on boot with static network configuration

Running Debian 10 Buster image (created with build-openstack-debian-image --release buster) with cloud-init image created by cloud-localds -v --disk-format raw --filesystem iso9660 --network-config=...
Xdg's user avatar
  • 347
1 vote
1 answer
756 views

How to configure multiple interface for cloud_init_nics using variables in ansible

i need some help on configure multiple cloud_init_nics using variable files. Here is my variable files for example: files/dict vm: all: - name: rhel7 hostname: rhel7 dns: "8.8.8....
sloweriang's user avatar
0 votes
1 answer
258 views

`cloud-init` does not block VM provisioning

I use Azure and I would like to use cloud-init to install some software on VM creation. Here is the content of cloud-init.yml: #cloud-config package_update: true package_upgrade: true runcmd: - ...
danielleontiev's user avatar
2 votes
1 answer
5k views

Escape characters in systemd ExecStart fail

I have the following snippet to extract a value from a jenkins server jnlp config file. It works out of the box in the terminal but not as a unit. I want a unit so I can put the value somewhere and ...
eignhpants's user avatar