-
Notifications
You must be signed in to change notification settings - Fork 908
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cloud-config provided in OpenStack vendor data is ignored #5221
Comments
This sounds like a bug in a Nova feature to me (or maybe even just a Nova feature request). I'm not sure what cloud-init is supposed to do about this. |
Unless I misunderstand and cloud-init is actually unable to use the cloud-init key in vendor_data2.json that is provided by Nova, I'm inclined to close this as "won't fix", since cloud-init appears to be working as intended. @frct1 Am I missing something? |
Same thing. Since cloud-init works fine if |
reviewing this form a nova perspective the cloud-init integration is not compatible with nova implemation and this looks to be a bug in cloud-init nova's implementation of vendor data expect the content of sopenstack/2016-10-06/vendor_data2.json to be a single json object containing a key per dynamic vendor data service with the content of the respocne for that backend being a valid json respocne sopenstack/2016-10-06/vendor_data2.json in this case we have two vender data backedn vendordata_dynamic_targets=[ when we parst vendor_data2.json that means we would expect the vendor data to look like { not { so https://cloudinit.readthedocs.io/en/latest/reference/datasources/openstack.html#vendor-data is not compatible with OpenStack and never has been as far as i can tell at a quick glance. |
just to clarify nova provide the following format in the vendor data
i.e.
we require vendor data backends to provide a json response so form my perspective there is a bug in at least the Cloudinit docs as the example provided in
is a valid reponce form a backend but its not a valid example fo the content of vendor_data2.json as produced by nova. it would look like this
supporting a different format that allowed adding content directly to the root object there may be one way to hack this to work today
and the backend provider returned just the cloud-init content
then that might work "#cloud-config\npackage_upgrade: True\npackages:\n - htop" then it might work even if that is technically not intended to work today |
@SeanMooney suggested a possible way to hack this while explicit support on provider data type is not implemented. from oslo_serialization import jsonutils
res = "#cloud-config\n..."
jsonutils.dumps(res) Following this way cloud-config returned as a raw string and counts as valid JSON. |
Bug report
I'm developing open source project https://github.com/ib-systems/openstack-consul-dynamic-vendordata that will help to easily provide vendor data to OpenStack instances using Consul KV. This is useful when operator works with a lot of independent geographically distributed clouds but store instances vendor data in distributed Consul KV used by billing software for example that unifying managing all of regions in the same interface.
Current cloud-init behavior expect
cloud-init
key to present atvendor_data2.json
to run provided#cloud-config
(docs link). But providing#cloud-config
as string is not possible in current vendor_data2.json DynamicJSON provider due to OpenStack Nova component expect JSON encoded response from vendor_data2.json provider.Log line when i tried to return string contains
#cloud-config
from vendor data service.raised at this line
I've created blueprint with possible workaround at Nova tracker but not sure that it will be accepted. Anyway this have to be solved after years of misconcerns.
Steps to reproduce the problem
Configure nova-api to request Dynamic
vendor_data2.json
Following nova specs vendor_data2,json will be returned in format as
Current dynamic vendordata on Consul KV is store in next format:
Following OpenStack specs there is could be a lot of different as called vendor data providers that could be used for licensing, software metadata and so on.
it works, but...
I've changed vendordata_dynamic_targets to
vendordata_dynamic_targets=cloud-init@http://10.10.10.10:8888
in order to havecloud-init
key invendor_data2.json
and then monkey-patched nova-api's metadata code inside docker container at this line to return plain text. So now i havevendor_data2.json
looks likethen as result cloud-init runs provided
#cloud-config
absolutely correct with no issues at all.I would like to propose possible solution for cloud-init to merge all of
#cloud-config
provided from all of providers and then continue basic behavior (override with user-data if provided or go ahead in processing pipeline). In case only one key is presented invendor_data2.json
like:I guess this is most used case for vendors) simply extract
#cloud-config
fromcloud-init
key (if provided).Environment details
cloud-init logs
None. Only log seen when JSON provided within
cloud-init
key invendor_data2.json
with "wrong format message".refs
Openstack's vendor_data2.json is not handled
openstack: read the dynamic metadata group vendor_data2.json
The text was updated successfully, but these errors were encountered: