I am trying to get userdata to run some commands on vps creation but it does not appear to run.
There is no error in cloud-init.log or cloud-init-output.log whatever I have tried i cannot get my cmds to run on server provisioning
In fact I did a test with just a simple cloud config, still didnt work.
For example as a test I pass in userdata field to api (obviously in base64 encoded)#cloud-config
- touch /var/log/test.txt
Nothing happened, test.txt does not appear in /var/log when the server has been provisioned
Looking in /var/lib/cloud/instance/scripts then runcmd script appears containing
and in cloud-init it appears to show runcmd is executing correctly:
grep runcmd cloud-init.log
Aug 11 21:02:12 guest [CLOUDINIT] stages.py[DEBUG]: Running module runcmd () with frequency once-per-instance
Aug 11 21:02:12 guest [CLOUDINIT] handlers.py[DEBUG]: start: modules-config/config-runcmd: running config-runcmd with frequency once-per-instance
Aug 11 21:02:12 guest [CLOUDINIT] util.py[DEBUG]: Writing to /var/lib/cloud/instances/fbe67d0bcc8d4b3e9050df1bc8e1bf81/sem/config_runcmd - wb:  24 bytes
Aug 11 21:02:12 guest [CLOUDINIT] helpers.py[DEBUG]: Running config-runcmd using lock ()
Aug 11 21:02:12 guest [CLOUDINIT] util.py[DEBUG]: Writing to /var/lib/cloud/instances/fbe67d0bcc8d4b3e9050df1bc8e1bf81/scripts/runcmd - wb:  34 bytes
Aug 11 21:02:12 guest [CLOUDINIT] handlers.py[DEBUG]: finish: modules-config/config-runcmd: SUCCESS: config-runcmd ran successfully
yet no joy?? Why are my cloud-config commands not been completed?
The last bit in cloud-init-output.log is the downloading of firstboot.exec (I have no startup script so this file just contains a line of text confirming that)
Cloud-init v. 0.7.7 running 'modules:config' at Thu, 11 Aug 2016 21:02:08 +0000. Up 17.92 seconds.
--2016-08-11 21:02:13-- https://api.vultr.com/v1/server/firstboot
Resolving api.vultr.com (api.vultr.com)... 184.108.40.206
Connecting to api.vultr.com (api.vultr.com)|220.127.116.11|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/plain]
Saving to: '/tmp/firstboot.exec'
2016-08-11 21:02:14 (3.66 MB/s) - '/tmp/firstboot.exec' saved 
Cloud-init v. 0.7.7 running 'modules:final' at Thu, 11 Aug 2016 21:02:13 +0000. Up 21.51 seconds.
>>> outputs from my commands should start appearing here.
Any ideas whats wrong how to solve?