-
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
docs: Add DataSourceNone documentation #5165
Conversation
@@ -12,6 +12,12 @@ provide configurations. | |||
Configuration Methods: | |||
====================== | |||
|
|||
.. warning:: |
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.
I don't love putting this here, but I do think we've had enough confusion about this that it should be called out on this page. I'm open to suggestions for a better location.
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.
I'm not even 100% clear on what this warning block means? I think this is a fine location for it though. And a warning is definitely worthwhile to provide, especially if its a known confusion point!
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.
@a-dubs if a user specifies datasource_list: [ nocloud ]
in /etc/cloud/cloud.cfg
and then expects user-data in files under /etc/cloud/
to be acted on by cloud-init, they may be surprised to know that they aren't using NoCloud. This was historically not an issue, since ds-identify would historically always add none
to the datasource_list. Since that changed in 24.1, this change may catch some users by surprise (hence this clarification).
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.
@holmanb could you please point me the exact change in 24.1? Some internal user did get caught by surprise by this change you talk about.
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.
@holmanb I have a further question for this change, could you please help to clarify this?
Just as @ani-sinha mentioned, we have some internal user did get caught by surprise by this change you talked about.
It reports "DataSourceNoCloud.py[DEBUG]: Seed from https://..../userdata/ not supported by DataSourceNocloud" in cloud-init.log with below config in cloud-init-23.4(But no such issue before 23.1):
# cat << EOM > /etc/cloud/cloud.cfg.d/10_datasource.cfg
datasource_list: [NoCloud]
datasource:
NoCloud:
seedfrom: https://satellite.example.com/userdata/
EOM
Could I know how to adapt it after the change?
Thanks!
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.
@zhaohuijuan @ani-sinha sometimes comments like get missed when commenting on old merged PRs - github notifications are the only way that these messages get notified and since there is no queue for reviewing old comments comments like this are more likely to get lost. IRC would be more likely to get a response.
To answer your question, I don't think that this log message indicates an actual issue:
DataSourceNoCloud.py[DEBUG]: Seed from https://..../userdata/ not supported by DataSourceNocloud
I think that this is just a spurious message, I've seen the same thing where in the next stage (Network stage) it works.
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.
Thanks @holmanb for the reminder and quick response. Seems I can not login the IRC #cloud-init ... So asking here.
It indeed broke the cloud-init implementation, not sure if this log related.
Per the latest cloud-init doc[1]: User data placed under /etc/cloud/ will not be recognized as a source of configuration data by the NoCloud datasource.
[1] https://cloudinit.readthedocs.io/en/latest/reference/datasources/nocloud.html
And the doc provides 4 configuration methods(e.g. command line), should we config NoCloud and seedfrom with one of the 4 methods?
But there is another example for NoCloud config[2], is it conflict with the above doc[1]?
[2] https://cloudinit.readthedocs.io/en/latest/reference/examples.html#configure-data-sources
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.
Thanks @holmanb for the reminder and quick response. Seems I can not login the IRC #cloud-init ... So asking here.
It indeed broke the cloud-init implementation, not sure if this log related.
I don't think that this log is related, but it sounds like there may be an issue that should be reported. There have been lots of different changes in this part of the code over the last two years. Without logs of the working and non-working instances this may be difficult to understand.
Can you please file a bug with the relevant logs?
Per the latest cloud-init doc[1]: User data placed under /etc/cloud/ will not be recognized as a source of configuration data by the NoCloud datasource.
[1] https://cloudinit.readthedocs.io/en/latest/reference/datasources/nocloud.htmlAnd the doc provides 4 configuration methods(e.g. command line), should we config NoCloud and seedfrom with one of the 4 methods?
But there is another example for NoCloud config[2], is it conflict with the above doc[1]?
[2] https://cloudinit.readthedocs.io/en/latest/reference/examples.html#configure-data-sources
This sounds like possibly confusion between user-data and system configuration, the doc referenced is not describing user-data I think.
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.
Ahh, you're referring to this:
# these are optional, but allow you to basically provide a datasource
# right here
user-data: |
# This is the user-data verbatim
meta-data:
instance-id: i-87018aed
local-hostname: myhost.internal
Yes, we should probably update the doc wording. You can use this subkey, which is technically defined within cloud.cfg files.
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.
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.
Thanks @TheRealFalcon, this is looking great!
I have a couple of nits, and a couple of questions since some of the described behavior seems unintuitive and/or undesireable.
available. | ||
2. As a fallback for when a datasource is otherwise intermittently | ||
unavailable. | ||
3. Providing user data to cloud-init from on-disk configuration when |
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.
when no datasource is available/present
is this any different than #1?
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.
I was trying to highlight testing as one of the primary use cases, but I suppose there's no meaningful difference and they can be combined.
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.
no objections to leaving it as is, that makes sense to me
|
||
When the datasource is ``None``, cloud-init is unable to obtain or | ||
render networking configuration. Additionally, when cloud-init | ||
completes, a warning is logged that DataSourceNone is being used. |
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.
a warning is logged that DataSourceNone is being used.
Is it logged if DatasourceNone is being used, or is it logged if this datasource is used as a fallback? I don't think that this is behavior that we actually want if only [None] is specified by the user, right?
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.
It happens regardless.
https://github.com/canonical/cloud-init/blob/main/cloudinit/config/cc_final_message.py#L114
I can create an issue to remove it if None has userdata/metadata or is the only entry in the datasource list.
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.
sounds good to me!
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.
@holmanb I believe I addressed your comments |
Can we also make sure this is reference/linked in the Breaking changes page created #5147 since we've had a lot of people breaking in different ways on this? |
@catmsred , nothing in this PR is new or is referencing behavior that has changed recently. If you're referring to the |
See #5171 |
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.
Thanks @TheRealFalcon, this looks good to me!
Proposed Commit Message
Merge type