While trying to use the AWS userdata
option to run a script on instance boot, I noticed that some times (Not always) the cloud init part gets stuck somewhere in the middle and does not reach the part where it runs the user script.
This is how it should look in the /var/log/cloud-init-output.log
file:
Cloud-init v. 0.7.5 running 'init-local' at Tue, 30 May 2017 06:38:40 +0000. Up 18.56 seconds.
Cloud-init v. 0.7.5 running 'init' at Tue, 30 May 2017 06:38:45 +0000. Up 23.39 seconds.
SOME_NETWORK_AND_SSH_KEYS_INFO_HERE
Cloud-init v. 0.7.5 running 'modules:config' at Tue, 30 May 2017 06:38:51 +0000. Up 28.80 seconds.
Generating locales...
en_US.UTF-8... up-to-date
Generation complete.
Cloud-init v. 0.7.5 running 'modules:final' at Tue, 30 May 2017 06:39:35 +0000. Up 73.20 seconds.
MY_USERDATA_SCRIPT_OUTPUT_HERE
But here is how it looks when its stuck:
Cloud-init v. 0.7.5 running 'init-local' at Tue, 30 May 2017 06:36:43 +0000. Up 21.80 seconds.
Cloud-init v. 0.7.5 running 'init' at Tue, 30 May 2017 06:36:51 +0000. Up 30.13 seconds.
SOME_NETWORK_AND_SSH_KEYS_INFO_HERE
Cloud-init v. 0.7.5 running 'modules:config' at Tue, 30 May 2017 06:36:59 +0000. Up 37.66 seconds.
Generating locales...
en_US.UTF-8... up-to-date
Generation complete.
As you can see, its stuck after the Generation complete
and thats it.
Any idea what can cause it and how I should mitigate it?
Btw, OS is Ubuntu 14.04