Cloud init does not come with the base instance I uploaded from Amazon(Fedora 16 x86_64), so I installed using

sudo yum install cloud-init

Now when I launch this instance via

ec2-run-instance -f my_bash_script

It copies my_bash_script to /var/lib/cloud/instances/user-data.txt

However, none of the commands in the script seem to be executed (mainly initializing chef)

I read online that CentOS uses user-data scripts get initialized from cloud-init-user-script on first boot. I assumed this would be the case with Fedora too, but this script does not exist on my system.

I ran

grep 'user-data.txt' /var/log/cloud-init.log

and it returned no results.

How can I get this configured correctly on Fedora so that I can execute user-data scripts upon instance creation?


Check whether your script given in user-data got created as executable script under /var/lib/cloud/instances/scripts/ if it got created then the init part has completed successfully.

After that cloud-init-cfg all final command needs to be executed and that's the one which calls the cloud_final_modules part of parameters in /etc/cloud/cloud.cfg file. Hence create a new service which can execute that command and the service should be named such that it run after the cloud-init service.

  • Thanks for the response. This might be the way to get user-data inputs working with F16. I figured out that the cloud-init user-data option did not work out of the box with F16, so I decided to use F18 instead, and it worked. Feb 22 '13 at 16:50

I figured out the issue was, that cloud-init was rushed into F16 at the last minute. As a result, out of the box, cloud-init only works with cloud-config setup. In order to get fedora to work with user-data input scripts, I decided to use a Fedora 18 AMI, where this functionality is included by default.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.