-
Notifications
You must be signed in to change notification settings - Fork 110
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
Correct how config_drive content is generated #2328
Conversation
Skipping CI for Draft Pull Request. |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cescgina The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
meta-data and network-data files is not If you want to validate network-config you need to use the correct schema type:
|
95e0c5d
to
0473d92
Compare
It seems older cloud-init, as 22.1 exposed in RHEL-9.2, is having issues with the way some of the content is generated, preventing to apply the whole configuration. Namely, in the libvirt_manager, we might have no network configuration; but in the config_drive, a file was created with `''` as content, leading to cloud-init to crash (not a valid YAML dict). This patch changes how configuration snippets are checked and generated. The error as detected by cloud-init was as follow: ``` [ 5.237126] cloud-init[744]: Cloud-init v. 22.1-9.el9 running 'init-local' at Mon, 09 Sep 2024 11:16:09 +0000. Up 5.21 seconds. [ 5.387470] cloud-init[744]: 2024-09-09 11:16:10,072 - util.py[WARNING]: Failed loading yaml blob. Yaml load allows (<class 'dict'>,) root types, but got str instead [ 5.389029] cloud-init[744]: 2024-09-09 11:16:10,072 - util.py[WARNING]: Getting data from <class 'cloudinit.sources.DataSourceNoCloud.DataSourceNoCloud'> failed ``` With newer cloud-init (23.x) as shipped by RHEL-9.4, the error wasn't fatal and it was still continuing to apply the other files (in this case, the user-data). In earlier version, it was a hard stop. Using `cloud-init devel schema -c <config-file>` also raised the missing header: ``` [root@builder2 /]# cloud-init devel schema -c config_drive/meta-data Error: Cloud config schema errors: format-l1.c1: File config_drive/meta-data needs to begin with "#cloud-config" ``` And adding the header, but without any actual data, lead to: ``` [root@builder2 /]# cloud-init devel schema -c config_drive/network-config Error: Cloud-config is not a YAML dict. ```
0473d92
to
ff12f03
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
It seems older cloud-init, as 22.1 exposed in RHEL-9.2, is having issues
with the way some of the content is generated, preventing to apply the
whole configuration.
Namely, in the libvirt_manager, we might have no network configuration;
but in the config_drive, a file was created with
''
as content,leading to cloud-init to crash (not a valid YAML dict).
This patch changes how configuration snippets are checked and generated.
The error as detected by cloud-init was as follow:
With newer cloud-init (23.x) as shipped by RHEL-9.4, the error wasn't
fatal and it was still continuing to apply the other files (in this
case, the user-data).
In earlier version, it was a hard stop.
Using
cloud-init devel schema -c <config-file>
also raised the missingheader:
And adding the header, but without any actual data, lead to: