Questions tagged [cloud-init]

152 questions
38
votes
4 answers

How to make EC2 user data script run again on startup?

After cloud-init runs a user data script on the first boot of an EC2 instance, a state file is presumably written so that cloud-init won't run the script again on subsequent reboots. There are cases where I'd like to delete this state file so that…
mconigliaro
  • 3,335
26
votes
8 answers

Where is log output from cloud-init stored?

Where does output from cloud-init (automatically runs scripts when starting up a virtual machine in the cloud, for example at Amazon EC2) go? I would like to know that my initialization scripts executed successfully. There is a…
Make Mark
  • 2,024
  • 4
  • 17
  • 16
11
votes
1 answer

AWS CLI throws "Unable to locate credentials", the second time it's run

I'm trying to download some files from S3 to an EC2 instance using the AWS CLI (1.8.7) on startup using a User-Data Script. This instance has a IAM Role & Instance Profile with the appropriate permissions. Sometimes, the CLI will fail with the error…
10
votes
1 answer

cloud-init module order is wrong, how to fix?

I'm using cloud-init to setup AWS EC2 machines running Ubuntu 14.04. One of the more useful features of cloud-init is the write_files module that allows me to install additional files during the initialization of the virtual machine. write_files has…
Guss
  • 3,080
10
votes
7 answers

How to create a swap for Azure Ubuntu VM?

I have read quite a few posts on this, but I am still unsure about the correct approach, assuming: I have a default Ubuntu 14.04 LTS VM created by and running on Azure, which doesn't come with a swap I would like to create a swap using existing VM…
bitinn
  • 331
9
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
  • 292
  • 1
  • 5
  • 13
7
votes
2 answers

How can a cloud-config script copy a file to a server?

How can a cloud-config script copy a file to a server? write_files requires the file content in the script. How can I specify an external file that contains the content?
Derek Mahar
  • 991
  • 3
  • 8
  • 16
7
votes
2 answers

How do I use cloud-init to configure an AWS EBS volume at first boot?

Cloud-init provides the disk_setup, fs_setup and mounts modules to partition, format and mount a volume to a virtual machine, however these options remain undocumented at both http://cloudinit.readthedocs.org and AWS. Does there exist a functional…
Graham Leggett
  • 287
  • 3
  • 15
7
votes
1 answer

cloud-init does not grow the partition nor the filesystem

I am currenty preparing OpenStack-ready images of CentOS 7 and Ubuntu 14.04. For the "automation" I use Packer, which is provided by you with a JSON-template. Packer then starts the installation using the virtualization you specify (in my case…
Korni22
  • 71
7
votes
4 answers

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 upon the first start-up the boot gets hung-up on […
6
votes
1 answer

ubuntu 18.04 network after cloud-init removal

I installed new Ubuntu 18.04 on my home server and i noticed that /etc/network/interfaces file is empty. After searching on internet I found out that version 18.04 uses cloud-init package to init networking and other stuff. I removed cloud-init…
user399240
6
votes
3 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…
5
votes
1 answer

How do I enable IPv6 on Fedora 28 on Amazon EC2

I can't seem to get IPv6 working in Fedora 28 in Amazon EC2 (so using cloud-init and DHCPv6). It works in RHEL 7 with the configuration described here. Applying the same configuration to Fedora 28 doesn't seem to do anything. In particular,…
5
votes
2 answers

Starting a long-running process in cloud-init on ec2 instance

I'm trying and failing to start a long-running command on launch of an EC2 (Amazon Linux). It needs to run under the ec2-user account. This was my first attempt: #!/bin/bash echo 'Woot 1!' > /home/ec2-user/woot1.txt pushd…
Tom Slee
  • 181
4
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
  • 548
1
2 3
10 11