Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

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.

share|improve this answer
    
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. –  Ed Sullivan Feb 22 '13 at 16:50
up vote 0 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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