-
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
DataSourceNoCloudNet not configurable via config files #5288
Comments
Relevant discussions and doc references : |
I believe the following change introduced the change in behavior
|
I just tested the same seed configuration (which I have used in the past) using cloud-init "git master" and it works as expected. I do see the same log message as mentioned in the issue report but this appears during mode "init-local":
however during mode "local-network" things work as expected:
|
Thanks for filing this issue. @mgollo can you please test to see if this issue persists on 24.1? We already fixed some bugs in this space that I believe may have fixed this issue.
Great analysis @mgollo. I think that this explains what you are seeing correctly.
This is a red herring. The log is telling the truth, but this isn't where the code change that caused this happens. You will see this on 24.1 today as well, where I believe this issue is already fixed.
@sayan3296 The docs that you link to describe relevant changes, but I don't think that they describe the one that that caused this. That comment isn't relevant to this issue. That comment was describing a situation in which users may have had an invalid configuration previously which silently worked before which would no longer will.
You aren't far off, but I don't think that this is where the change was actually introduced. The reason is that when 612b4de landed, Aside
I wouldn't describe this as "forked off". All that really happened is that the user interface was simplified so that cloud-init could discern from the |
@dermotbradley I didn't see your message until after I posted. Thanks for independently confirming that this is indeed already fixed in upstream cloud-init. |
wow! What a convoluted mess. We are checking if cdbbd17ae400e4 fixed it for us. |
I have just manually installed the latest main branch on a test VM and I can confirm that the issue is resolved there. |
Hello @mgollo , Thanks for confirming. Other than applying the patch [ using latest main branch ], Did you need to change anything in the cloud-init config of the template itself ? I mean, Do you have a similar |
@ani-sinha I confirm b489e4f is the specific change that fixes the issue .. Please see if this can be backported. |
@sayan3296 |
@ani-sinha Agreed, and very sorry for the churn :-/ These fixes stemmed from the requirement to support OpenStack on bare metal. @mgollo @sayan3296 Thanks for confirming. |
@holmanb
Therefore,
which is part of the commit
which was subsequently overwriten by
So now we positively need a non-empty list for Previous case:
Now:
|
@ani-sinha , can you help me understand the use case here a bit more? Do you know how your customers are passing their NoCloud data to the instance? You are correct that Based on your logs, seeing many datasources listed from the Python code, it appears that |
@TheRealFalcon , below is the details about the regression issue. Bug description: Using the loopback device to insert an cloudinit.iso and trigger cloud-init like below, no network data found from DataSourceNoCloudNet. modprobe loop Note that it works if inserted as CD into the VM and reboot. Test steps:
$ cat meta-data $ cat user-data
Actual results: Additional info: cloud-init.log: |
Another data point is, as per Method 1 in https://cloudinit.readthedocs.io/en/latest/reference/datasources/nocloud.html#configuration-methods we have
The problem here is
|
Some more observations ..
This means
Also, on both cases,
So my suspicion is that
It was able to find the mounted iso. I do see this log in the working case in
This log is missing in the non-working case completely. So the fundamental question is why |
I can't seem to find where |
Another thing our customers have reported is that doing |
Ah I see what is going on
This means, in order to detect local datasources, one has to explicitly so |
See https://github.com/canonical/cloud-init/blob/main/cloudinit/sources/DataSourceNoCloud.py#L415-L418 . In local timeframe, cloud-init uses the NoCloud datasource. In network timeframe, it uses NoCloudNet. NoCloud doesn't override ds_detect() as so falls through the the base class which simply returns If adding |
I do think that it's important to remember that cloud-init's primary use case is provisioning cloud instances on boot. We have 5 separate stages that run at boot, and later stages can and do rely on state that has been generated from earlier stages. While we generally try to maintain existing functionality without many breaking changes across version boundaries, that same expectation is not extended to running the services or the cloud-init binary ad hoc, especially when the services are not all run or are run out of order. |
Yes I figured that out yesterday. I think |
One final question. https://cloudinit.readthedocs.io/en/latest/reference/datasources/nocloud.html does not explicitly say that |
If by |
But why in the network case it does not also look into the file system for iso9660 ? Why just kernel command line and smbios? |
Because those are the only valid sources of network seed data. During During |
Bug report
When DataSourceNoCloudNet had not yet been forked off DataSourceNoCloud, the following config would allow loading the config file via HTTP without kernel command line parameters or SMBIOS serial:
This configuration was tested and working with RHEL 8.8 VMware VM templates with an injected network configuration and cloud-init 22.1. In the old version of DataSourceNoCloud, the configuration would be read, the URL would be called and the configuration applied.
In RHEL 9.4 with cloud-init 23.4 (also if the latest DataSourceNoCloud.py from main branch was manually applied), this configuration leads to cloud-init detecting DataSourceNoCloud (as before), which no longer supports http* seedfrom URLs. It would have to detect DataSourceNoCloudNet, but the ds_detect function of the DataSourceNoCloudNet class only checks SMBIOS serials and the kernel command line.
Therefore DataSourceNoCloudNet cannot be configured via /etc/cloud.
Steps to reproduce the problem
Use the above config snippet in /etc/cloud/cloud.cfg.d/10_foreman.cfg and no SMBIOS serial or kernel command line.
Environment details
cloud-init logs
The text was updated successfully, but these errors were encountered: