I am working with OpenStack Pike and cloud-init 21.1. I am able to successfully pass dynamic vendor data to the config drive of an instance. However, cloud-init 21.1 just reads all the 'x' bytes of the vendor_data2.json but it doesn't execute the contents of the json. Although, static vendor data works perfectly fine and the YAML file in the JSON is executed as expected by cloud-init 21.1
* Now, the person who wrote the code for handling dynamic vendordata in cloud-init (https://github.com/canonical/cloud-init/pull/777) says that the JSON cloud-init expects is of the form:
{"cloud-init": "#cloud-config\npackage_upgrade: True\npackages:\n - black\nfqdn: cloud-overridden-by-vendordata2.example.org."}
{
"name1": {
"cloud-init": "#cloud-config\n..."
},
"name2": {
"cloud-init": "#cloud-config\n..."
}
}