Questions tagged [cloud-init]

131 questions
4
votes
1 answer

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 guess it's hard to define the "first time" (the…
miho
  • 232
  • 5
  • 13
4
votes
2 answers

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 shell - but that feels like a very wonky…
tcurdt
  • 413
  • 1
  • 4
  • 10
3
votes
1 answer

Why is my ec2 instance sometimes not terminating when I use 'shutdown now'?

I am running a user-data script on startup of an ec2 machine which shuts the machine down after checking the exit status of the last executed command. I confirmed that the last executed command ran successfully, so I am not sure why the machine is…
3
votes
1 answer

How do I attach, format and mount a volume on boot in ecs?

I want my persistence (ebs) volume to be separate from my auto-scaling group launch configuration. So that it won't be accidentally auto deleted by terraform, or something. Also I may do something like /mnt/taskname so that I have a different…
xenoterracide
  • 1,496
  • 2
  • 13
  • 26
3
votes
0 answers

Trouble with cloud-init user-data on Ubuntu on vSphere

I feel like I must be missing something obvious here. So I'm hoping someone can tell me why I'm being dumb before I try to submit an official bug report. I recently downloaded the OVA version of the Ubuntu 16.04 cloud image and am attempting to…
Ryan Bolger
  • 16,755
  • 4
  • 42
  • 64
3
votes
1 answer

cloud-init does not insert instance level ssh keys in gce

I am passing (YAML representation) metadata: items: - key: sshKeys value: root:ssh-rsa AAAAB... non@nan when creating a gcloud instance. But I cannot ssh to the instance $ ssh 139.242.197.104.bc.googleusercontent.com Host key fingerprint is…
akostadinov
  • 1,178
  • 1
  • 9
  • 18
3
votes
2 answers

how to disable executing user-data by cloud-init

I am making a new AMI in EC2 and want to disable it running anything that could be put in user-data when launching (or rebooting) from this AMI. I looked at the existing /etc/cloud/cloud.cfg and /etc/cloud/cloud.cfg.d/* but do not see where this is…
Skaperen
  • 1,094
  • 2
  • 11
  • 23
3
votes
1 answer

Centos6 with cloud-init takes longer boot time

Centos-6.6 vm image takes almost ten minutes of boot time when ran using virsh. I captured the logs using virsh console. It looks like this, ci-info: +-------+---------------+---------------+---------------+-----------+-------+ ci-info: | Route | …
Madhavan
  • 133
  • 1
  • 7
3
votes
1 answer

cloud-init script with args (parametrized)

Long Story I'm preparing cloud-init scripts for instaling monitoring software agent (disclaimer: I'm one of the founders of MonitOwl). The agent software collect information (like memory or network stats) and send it to server. Each company group…
neutrinus
  • 1,125
  • 7
  • 18
3
votes
1 answer

How Can I Update user-data on Openstack?

I have a bunch of openstack VMs running on Grizzly. I need to change their domain which is currently managed by cloud-init. How do I update the user-data?
dmourati
  • 25,540
  • 2
  • 42
  • 72
3
votes
2 answers

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…
Jaroslav Kucera
  • 1,545
  • 11
  • 18
3
votes
6 answers

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=network-config-v2.yaml seed.img…
Xdg
  • 327
  • 6
  • 14
2
votes
1 answer

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 first: No match for argument: htop 2019-10-21…
Chef Tony
  • 401
  • 1
  • 3
  • 8
2
votes
2 answers

`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 many times. Each call introduces a 25 second…
Bruno Bronosky
  • 4,529
  • 3
  • 26
  • 34
2
votes
1 answer

Set hostname using cloudinit for dhcp server: Systemd overrides cloudinit hostname

For a testing environment, I want to connect multiple VMs using DHCP with their hostnames as DNS entrys. The troubleshooting shows that my DNS/DHCP works. But the VM got registered using ubuntu as hostname instead of my own (k8sm in this example):…
Lion
  • 506
  • 10
  • 21
1
2
3
8 9