Trouble provisioning new server using cloud-config/cloud-init/metadata
I seem to be unable to create a server with the proper configuration via CloudInit. As instructed here (https://www.digitalocean.com/community/tutorials/how-to-use-cloud-config-for-your-initial-server-setup) and here (https://www.digitalocean.com/community/tutorials/an-introduction-to-cloud-config-scripting), I created a YAML file that I pass in to the API when creating a droplet under the key “user_data”. It is a utf-8 encoded string.
I am attempting to create a 512mb droplet, on nyc3, using image ‘ubuntu-14-04-x64’.
I trigger the droplet creation via POST. The API returns with normal expected values, no errors.
Unfortunately, when I log in to the newly created droplet, it doesn’t seem as though the script has run. I tried creating it through the panel, pasting the contents of the script into the “user_data” field. This doesn’t seem to work either.
/var/log/cloudinit.log and /var/log/cloudinit-output.log don’t give any indication that my script has run.
You can review my YAML file here, in case there’s a syntax error I’ve missed: http://pastebin.com/ZL14ihjH
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.×