cloud-init icon indicating copy to clipboard operation
cloud-init copied to clipboard

[docs]: Incorrect guide for loading NoCloud config from local filesystem.

Open MarekZydor opened this issue 1 year ago • 4 comments

Documentation request

As described, configuration can be loaded from the local filesystem using the following format: ds=nocloud;s=file://path/to/directory/

But, the prefix file:// is inappropriate as it corrupts the path. The correct version is: ds=nocloud;s=/path/to/directory/ Additionally, it would be good to mention that the only two configuration files are required:

  • user-data
  • meta-data (must exist even if empty)

Reported from: https://cloudinit.readthedocs.io/en/latest/reference/datasources/nocloud.html

MarekZydor avatar Oct 27 '24 23:10 MarekZydor

the prefix file:// is inappropriate as it corrupts the path

What do you mean by "corrupts"? Are you saying that this syntax doesn't work?

holmanb avatar Nov 01 '24 09:11 holmanb

Yes, this syntax doesn't work. I spent many hours trying to figure out why the config wouldn't load. Removing that prefix fixed it.

MarekZydor avatar Nov 01 '24 12:11 MarekZydor

@MarekZydor, in order to assess the problem, cloud you please attach the output of cloud-init collect-logs from an affected instance?

aciba90 avatar Nov 18 '24 11:11 aciba90

@aciba90 Here you go. cloud-init.tar.gz You can check how I passed kernel command line parameters in dmesg.txt. Also, see run/cloud-init/status.json file, which says that file::// seed is unknown.

MarekZydor avatar Dec 01 '24 20:12 MarekZydor

Thanks, @MarekZydor, and apologies for the delayed response. It looks there that the seed is incorrectly specified. Your kernel cmdline is:

KERNEL_CMDLINE=BOOT_IMAGE=/casper/vmlinuz autoinstall ds=nocloud;s=file://cdrom/nocloud/ ---

Your path is missing a leading slash, it should be:

file:///cdrom/nocloud/

As is, the parsing logic is splitting after the first / after removing the schema part (file://), and considering /nocloud as the seed directory.

aciba90 avatar Sep 05 '25 14:09 aciba90