Questions tagged [cloud-init]

CloudInit is a set of python scripts and utilities that handles initialization and configuration of cloud instances. It is installed in the Ubuntu Cloud Images and also in the official Ubuntu images available on EC2.

CloudInit is a set of python scripts and utilities that handles initialization and configuration of cloud instances. It is installed in the Ubuntu Cloud Images and also in the official Ubuntu images available on EC2.

387 questions
85
votes
4 answers

Why do people use Puppet/Chef with Amazon Cloud Formation instead of just using CloudInit?

We're planning to use AMI EC2 instances which are not "pre-baked". I.e. when they are spun up, they are bare installs of AWS linux. Our bootstrap process will pull in the various installs that we need e.g. python, tomcat. We'll have min of 3…
BestPractices
  • 12,738
  • 29
  • 96
  • 140
69
votes
9 answers

How do I make cloud-init startup scripts run every time my EC2 instance boots?

I have an EC2 instance running an AMI based on the Amazon Linux AMI. Like all such AMIs, it supports the cloud-init system for running startup scripts based on the User Data passed into every instance. In this particular case, my User Data input…
Adrian Petrescu
  • 16,629
  • 6
  • 56
  • 82
45
votes
6 answers

How to run cloud-init manually?

I'm writing a CloudFormation template and I'm trying to debug the user-data script I provide in the template. How can I run the cloud-init manually and make it perform the same actions it does when starting a new instance?
Fluffy
  • 27,504
  • 41
  • 151
  • 234
44
votes
1 answer

cloud-init: What is the execution order of cloud-config directives?

What is the order of the directives in the cloud-config section of a cloud-init user-data object. This is important to avoid race type conditions. I know bootcmd runs early and before runcmd, but is there a good list of the order of all the…
cgseller
  • 3,875
  • 2
  • 19
  • 21
36
votes
4 answers

How do I set up cloud-init on custom AMIs in AWS? (CentOS)

Defining userdata for instances in AWS seems really useful for doing all kinds of bootstrap-type actions. Unfortunately, I have to use a custom CentOS AMI that didn't originate from one of the provided AMIs for PCI reasons, so cloud-init is not…
whereswalden
  • 4,819
  • 3
  • 27
  • 41
35
votes
5 answers

How to re-run cloud-init without reboot

I am using openstack to create a VM using 'nova boot' command. My image is cloud-init enabled. I pass a --user-data script which is a bash shell format for cloud-init to run during VM boot up time. All this happens successfully. Now my use-case is…
user3532850
  • 351
  • 1
  • 3
  • 4
33
votes
3 answers

Where to find logs for a cloud-init user-data script?

I'm initializing spot instances running a derivative of the standard Ubuntu 13.04 AMI by pasting a shell script into the user-data field. This works. The script runs. But it's difficult to debug because I can't figure out where the output of the…
cbare
  • 12,060
  • 8
  • 56
  • 63
21
votes
6 answers

How do I install docker using cloud-init?

I want to create instances in Openstack that will have Docker in them already installed prior to ssh to them. So naturally I got interested in Cloud-init technology because it allows us to install packages on virtual machines during first boot time.…
lgdelacruz
  • 399
  • 2
  • 4
  • 7
17
votes
2 answers

Append with cloud-init write_files

When using write_files with cloud-init, is it possible to append content? If so, how? write_files: [ { "path": "/home/user/some-file", "content": "\nLine to append!" } ]
Brad
  • 159,648
  • 54
  • 349
  • 530
17
votes
2 answers

AWS-Ubuntu-Git Setup error fatal: $HOME not set

I have some cloudinit scripts to execute when my AWS EC2 Ubuntu instance starts up. I want to setup GIT config variables, with the code below. #cloud-config runcmd: - [ sh, -c, "git config --global user.name 'myname'"] When logged into the…
user1811107
  • 729
  • 3
  • 18
  • 39
17
votes
2 answers

What to bake into an AWS AMI and what to provision using cloud-init?

I'm using AWS Cloudformation to setup numerous elements of network infrastructure (VPCs, SecurityGroups, Subnets, Autoscaling groups, etc) for my web application. I want the whole process to be automated. I want click a button and be able to fire up…
Saqib Ali
  • 11,931
  • 41
  • 133
  • 272
17
votes
4 answers

How can I (securely) download a private S3 asset onto a new EC2 instance with cloudinit?

I'm using CloudFormation to manage a Tomcat webserver stack but am tired of doing raw AMI management for new application versions. I'd like to move in the direction of Chef but don't have the time right now. Instead, I'm trying to conquer a simple…
Christopher
  • 42,720
  • 11
  • 81
  • 99
16
votes
2 answers

How to use cloud-init with a debian-based image on Google Cloud?

Following terraform best practice for bootstrapping instances, I'm working on a cloud-init config in order to bootstrap my instance. My only need is to install a specific package. My terraform config looks like this: resource…
15
votes
5 answers

How do detect that cloud-init completed initialization

I am configuring an OpenStack box using cloud-init/cloud-config. I intend to wait until it is fully configured before I start using it. This is not all that hard to do using some marker file or detecting if the cloud-init process is still running,…
Oliver Gondža
  • 3,386
  • 4
  • 29
  • 49
14
votes
6 answers

What is the Cloud-Init equivalent for Windows?

It seems that the stock bootstrapping process is a bit lacking on Windows. Linux has cloud-init which will install packages, store files, and run a bash script from user data. Windows has ec2config but there is currently no support to run a cmd or…
Peter Stephens
  • 1,040
  • 1
  • 9
  • 23
1
2 3
25 26