Run script using Vendor Data JSON on OpenStack Ironic
Hello,
I watched a video from the Sydney OpenStack Summit: https://www.youtube.com/watch?v=bSaxUuwyLI4 (https://www.youtube.com/watch?v=bSaxU...)
I also read a blog post: http://www.stillhq.com/openstack/000022.html (http://www.stillhq.com/openstack/0000...)
I’m very interested in utilizing static vendor data in my OpenStack cloud. I was able to get a simple script to show up in vendor_data.json.
# curl http://169.254.169.254/openstack/latest/vendor_data.json
{"cloud-init": "#!/bin/bash\necho 'I am vendor data.' > /root/vendor_data.txt”}
What didn’t happen as I had hoped was that cloud-init actually executed this script.
I didn’t see any examples anywhere of actual scripts being executed. Do I have the key incorrect? "cloud-init"? I saw that on a RackSpace example: http://madorn.com/openstack-metadata-types.html (http://madorn.com/openstack-metadata-...)
{
"cloud-init": "#cloud-config\nfinal_message: This is Vendor Data for the Austin OpenStack Summit Workshop by Rackspace Training"
}
This is also reference similar here: https://github.com/cloud-init/cloud-init/blob/6ee8a2c557ccdc8be54bcf8a8762800c10f3ef49/cloudinit/sources/DataSourceIBMCloud.py#L45 (https://github.com/cloud-init/cloud-i...)
{"cloud-init":"#!/bin/bash\necho 'root:$6$<snip>' | chpasswd -e"}
I see this in the /var/log/cloud-init.log:
2018-12-10 20:48:58,005 - handlers.py[DEBUG]: finish: init-network/consume-user-data: SUCCESS: reading and applying user-data
2018-12-10 20:48:58,005 - handlers.py[DEBUG]: start: init-network/consume-vendor-data: reading and applying vendor-data
2018-12-10 20:48:58,005 - stages.py[DEBUG]: no vendordata from datasource
2018-12-10 20:48:58,005 - handlers.py[DEBUG]: finish: init-network/consume-vendor-data: SUCCESS: reading and applying vendor-data
Any assistance would be very much appreciated.
EDIT:
Another useful bit of information that I'm not sure is relevant is this is OpenStack Ironic. And it looks like maybe cloud-init thinks this is Ec2? I'm looking into this now.
Thank you,
Cody Hill