Cloud-init not executing on Fedora 16

amazon ec2cloud-initfedora

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?

Best Answer

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.