As of May 31, 2023, we have updated our Code of Conduct.

Questions tagged [cloud-init]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
59 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
0 votes
1 answer
119 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
21 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
194 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
  • 3
1 vote
2 answers
885 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
  • 127
0 votes
1 answer
85 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
  • 197
0 votes
0 answers
361 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
  • 143
3 votes
2 answers
2k 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
790 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
481 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
  • 35
1 vote
1 answer
496 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
243 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
120 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
472 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
384 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 ...
andres's user avatar
  • 101
-3 votes
1 answer
219 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
  • 911
1 vote
1 answer
1k 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
0 votes
1 answer
554 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
935 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
3 votes
1 answer
6k 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
  • 212
1 vote
2 answers
2k 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
  • 11
0 votes
1 answer
1k 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
8k 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
297 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
822 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
456 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
2k 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
  • 293
2 votes
1 answer
1k 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
234 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
294 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
  • 17
0 votes
1 answer
1k 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
6k 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
  • 327
1 vote
1 answer
531 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
202 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
3k 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
2 votes
0 answers
385 views

How to use cloud config in pxe boot?

I am using netbootxyz in order to boot my Ubuntu environments. In matter of the facts, is that I am using pre-seed configuration. The problem is that there are some minor bugs: gnome-terminal is not ...
Nikolay Kostov's user avatar
1 vote
0 answers
210 views

How to pass VM name (not hostname) to VM during provisioning

THE SHORT VERSION When provisioning a new VM through the vCenter API, we need to pass the VM's given name (the name given in the vCenter UI, not the hostname) to the OS during the initial boot/...
Kodo's user avatar
  • 121
2 votes
0 answers
2k views

Cloud Init with Flatcar Linux -- Configuration not applying when passing custom file?

I'm using Telmate's Terraform provider for Proxmox and trying to deploy Flatcar linux virtual machines using Cloud Init by passing files via cicustom. Based on their example, I have crafted the ...
TJ Zimmerman's user avatar
1 vote
2 answers
3k views

powershell user data script run on restart of the Windows instance

We have windows servers that do application initialization which takes almost 3-4 hours for servers to be online. So to avoid downtime we use autoscaling group lifecycle hooks. Now we want to shut ...
Shailesh Sutar's user avatar
0 votes
0 answers
213 views

Can't reconnect VPS Essential OVH after removing set_hostname from cloud-init

I have a VPS Essential in OVH with Ubuntu 18.04 LTS installed. I just removed the set_hostname module of the cloud_init_modules from /etc/cloud/cloud.cfg and reboot the system and now I cannot connect ...
Nico's user avatar
  • 113
6 votes
4 answers
41k views

Boot issue on clean Ubuntu Server 20.04 system

I have recently installed Ubuntu 20.04 on a hdd in my 2009 Mac pro 4,1 (flashed to 5,1). I've wiped and reinstalled 3 times at this point. All three times, The installation goes without a hitch but ...
Weymouth Solutions's user avatar
0 votes
1 answer
615 views

Set ipv6 addres/gateway with cloud-init

In CentOS 7.3 I had the following in /etc/sysconfig/network-scripts/ifcfg-eth0: IPV6INIT=yes IPV6ADDR=[address]/64 IPV6_DEFAULTGW=[gateway address] This worked fine. However, now that 7.4 uses cloud-...
Tom B's user avatar
  • 185
0 votes
1 answer
750 views

Updating cloud-init on Azure Scale Set with ARM

I have an ARM template that deployes a scaleset to Azure and creates configuration files and runs a docker container via cloud-init. All this works file and we have Azure DevOps running the template ...
Dimse's user avatar
  • 101
0 votes
1 answer
1k views

cloud-init script with jinja template is not being processed with iinja

I have a cloud-init script, that is using jinja templating. It looks like this: ## template: jinja #cloud-config merge_how: - name: list settings: [append] - name: dict settings: [no_replace,...
feroze's user avatar
  • 245
1 vote
1 answer
2k views

Cloud-init: Add apt source key gnupg not installed

I've a cloud-init script that is used to create and configure a Debian 10 VM and since I want to install nginx I have to add its repository to APT. I'm trying to do it like this: apt: ...
TCB13's user avatar
  • 1,136
2 votes
1 answer
1k views

How can I enable epel-release before installing packages with cloud-init?

I'm trying to install a few packages on CentOS 8 via cloud-init, like this: package_upgrade: true packages: - firewalld - htop One of them one of them requires epel-release repo to be installed ...
Chef Tony's user avatar
  • 401
0 votes
1 answer
4k views

how to add network configuration to cloud init image to run a kvm image

I'm trying to use CloudInit to spin up VMs in a KVM hypervisor environment. I have downloaded the Ubuntu 18.04 image and created the following config file: #cloud-config package_upgrade: true users:...
moses poudineh's user avatar
2 votes
2 answers
2k views

`sudo` commands in cloud-init are SLOW! How to fix?

I am trying to bootstrap a Centos7 EC2 instance (ami-02eac2c0129f6376b) with bash user-data. Because it runs as root and I need to create a lot of things as the centos user, I use sudo -Hu centos <...
Bruno Bronosky's user avatar
0 votes
0 answers
322 views

Fedora 30 cloud-init unable to render networking error

I created a Fedora 30 template on Proxmox with KVM virtualization. When I create a VM from template and start it with cloud-init drive configured properly, I get unable to render networking error. ...
jwalker's user avatar
  • 98