Initial spec on cloud-init for dynamic vendordata

Implements blueprint dynamicjson-vendordata-cloud-config
Change-Id: I987b9052ee3dafb549c067ab0852787567c559c5

Change-Id: I074042f89ecd154422ad9df8f17b869da6ab0432
This commit is contained in:
Baikov Ilia 2024-04-26 06:11:02 +03:00
parent ae9a0631ea
commit 4942c93287
1 changed files with 186 additions and 0 deletions

View File

@ -0,0 +1,186 @@
..
This work is licensed under a Creative Commons Attribution 3.0 Unported
License.
http://creativecommons.org/licenses/by/3.0/legalcode
=================================================================
Allow vendors to provide cloud-config via DynamicJSON vendor data
=================================================================
https://blueprints.launchpad.net/nova/+spec/dynamicjson-vendordata-cloud-config
Problem description
===================
Current implementation of DynamicJSON wraps all responses to service-name
specific objects. This feature is [supported by
cloud-init](https://cloudinit.readthedocs.io/en/latest/reference/datasources/openstack.html#vendor-data)
but not possible to use with current DynamicJSON vendor data implementation.
Have to be implemented for open source project to allow vendors store
cloud-config in Consul Key-Value in easy way
https://github.com/ib-systems/openstack-consul-dynamic-vendordata
There is old abandoned issue:
[1](https://bugs.launchpad.net/cloud-init/+bug/1841104)
Use Cases
---------
Providing cloud-config via vendor data could be used to update packages or to
install/upgrade and not to use user-data for this to let user customize generic
instances with his own settings. While developing
https://github.com/ib-systems/openstack-consul-dynamic-vendordata observed that
current implementation doesn't allow to provide cloud-config via vendor data.
Proposed change
===============
I propose to let vendors define cloud-init specific vendor data source like ```
vendordata_dynamic_targets = 'cloud-init@http://10.10.10.10:8000/ocdv' ``` to
provide cloud-init as expected format to cloud-init. Following this way vendor
need to return single-lined #cloud-config to get it work.
Additional check at DynamicJSON provider is required
[here](https://opendev.org/openstack/nova/src/branch/master/nova/api/metadata/vendordata_dynamic.py#L95)
``` if service_name == "cloud-init":
return res.text
if res and res.text:
# TODO(mikal): Use the Cache-Control response header to do some # sensible
form of caching here. return jsonutils.loads(res.text)
```
Alternatives
------------
None
Data model impact
-----------------
None
REST API impact
---------------
None
Security impact
---------------
None
Notifications impact
--------------------
None
Other end user impact
---------------------
None
Performance Impact
------------------
None
Other deployer impact
---------------------
This have to be explicitly configured by cloud operator for example ```
vendordata_dynamic_targets = 'cloud-init@http://10.10.10.10:8000/ocdv' ```
Developer impact
----------------
None
Upgrade impact
--------------
None
Implementation
==============
Assignee(s)
-----------
Primary assignee:
https://launchpad.net/~iliabaikov
Other contributors:
None
Feature Liaison
---------------
Liaison Needed
.. _`nova core team`: https://review.opendev.org/#/admin/groups/25,members
Work Items
----------
- Create patch that handle `cloud-init` service name and bypass json parse
stage;
- Look on members review to add fixes if needed;
- Merge to other releases;
Dependencies
============
This feature doesn't require new library or any dependencies.
https://github.com/ib-systems/openstack-consul-dynamic-vendordata depends on
dynamic vendor data implementation. This is open source project that allow
vendors to provide cloud-config via vendor-data using Consul Key-Value feature.
This is very useful in case operator working with a lot of geographically
distributed clouds along with a distributed Consul cluster used by cloud
management tools for example billing software.
Testing
=======
Since this change could be "2 lines" hardcoded no tests needed, but i'm ready
to create one if needed.
Documentation Impact
====================
https://docs.openstack.org/nova/latest/admin/vendordata.html
We could add paragraph that in case operator would like to provide cloud-config
over dynamic vendor data he need to configure specific service like
"cloud-init@controller:8000/ocdv"
References
==========
- [https://bugs.launchpad.net/cloud-init/+bug/1841104](Old issue that been
abandoned)
[https://github.com/ib-systems/openstack-consul-dynamic-vendordata](OpenStack
Consul dynamic vendor data) project to let operator manage vendor-data using
Consul Key-Value feature.
History
=======
Optional section intended to be used each time the spec is updated to describe
new design, API or any database schema updated. Useful to let reader understand
what's happened along the time.
.. list-table:: Revisions
:header-rows: 1
* - Release Name
- Description
* - 2024.2 Dalmatian
- Introduced