Skip to content
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

Merged
merged 2 commits into from
Apr 19, 2024

Conversation

TheRealFalcon
Copy link
Member

Proposed Commit Message

docs: Add DataSourceNone documentation

Merge type

  • Squash merge using "Proposed Commit Message"
  • Rebase and merge unique commits. Requires commit messages per-commit each referencing the pull request number (#<PR_NUM>)

@@ -12,6 +12,12 @@ provide configurations.
Configuration Methods:
======================

.. warning::
Copy link
Member Author

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.

Copy link
Collaborator

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!

Copy link
Member

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).

Copy link
Contributor

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.

Copy link

@zhaohuijuan zhaohuijuan May 8, 2024

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!

Copy link
Member

@holmanb holmanb May 8, 2024

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.

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

Copy link
Member

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.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

This sounds like possibly confusion between user-data and system configuration, the doc referenced is not describing user-data I think.

Copy link
Member

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.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @holmanb
I think you already involved in the issue: #5288, thanks for your clarification

Copy link
Member

@holmanb holmanb left a 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.

doc/rtd/reference/datasources/nocloud.rst Outdated Show resolved Hide resolved
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
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

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.
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good to me!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doc/rtd/reference/datasources/none.rst Outdated Show resolved Hide resolved
@TheRealFalcon
Copy link
Member Author

@holmanb I believe I addressed your comments

@catmsred
Copy link
Collaborator

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?

@TheRealFalcon
Copy link
Member Author

@catmsred , nothing in this PR is new or is referencing behavior that has changed recently. If you're referring to the datasource_list changes, I'll file that separately.

@TheRealFalcon
Copy link
Member Author

See #5171

@holmanb holmanb self-assigned this Apr 12, 2024
Copy link
Member

@holmanb holmanb left a 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!

@TheRealFalcon TheRealFalcon merged commit 5a40b3b into canonical:main Apr 19, 2024
28 checks passed
@TheRealFalcon TheRealFalcon deleted the doc-none branch April 19, 2024 00:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants