Friday, May 3, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 14426  / 1 Year ago, thu, november 17, 2022, 7:36:07

Does anybody figured out the right way of providing autoinstall data with custom iso file via grub?
Clearly Ubuntu 22.04 doesn't provide the nice way of definition of boot commands via casper (sort of interactive menu [after boot, F6 and so on..]) like Ubuntu 20.04 does.


Starting point:



  • Ubuntu 22.04 iso file downloaded from Ubuntu site.

  • custom iso file with user-data and meta-data


Custom iso contains:



  • user-data with 'answers' for installer

  • meta-data is an empty file


Iso file is created by this command:
mkisofs -V cidata -lJR -o custom.iso user-data meta-data


So the mark 'cidata' (necessary as cloud-init documentation describes) is present.
Now once the vm is created and started installer simply fails to find answer file and it starts with the installer guide instead. However user-data can be found in this path:


/var/lib/cloud/instances/nocloud/user-data.txt

This file contains the original data I've created.


Now the most important part is the GRUB, that looks like:


       `linux /casper/vmlinuz autoinstall quiet "ds=nocloud;s=/" ---
initrd /casper/initrd
boot`

This example should be just fine, however it is not. Even if I provide full path to the file - it is a no go. I also tried to provide answer files via http server, but result is the same.


That example:


       `linux /casper/vmlinuz autoinstall quiet ---
initrd /casper/initrd
boot`

Should be enough as well but it doesn't work either.
Any ideas, anyone?


EDIT 26.5.2022
Found some working piece at least with http server. So working boot command is:


       `linux /casper/vmlinuz --- autoinstall quiet 'ds=nocloud-net;s=http://192.168.100.100/'
initrd /casper/initrd
boot`

Now further info about additional iso file. I think it's not being mounted properly. Since with this command:


       `linux /casper/vmlinuz --- autoinstall quiet
initrd /casper/initrd
boot`

I see a user-data.txt file in this path:


/var/lib/cloud/instances/nocloud/user-data.txt

That is fine, some logs however show:


cat /var/log/cloud-init-output.log Cloud-init v. 22.1-14-g2e17a0d6-0ubuntu1~22.04.5 finished at Thu, 26 May 2022 10:52:10 +0000. Datasource DataSourceNoCloudNet [seed=cmdline,/var/lib/cloud/seed/nocloud,/dev/sr1][dsmode=net]. Up 63.17 seconds


cat /var/log/cloud-init.log 2022-05-26 10:51:24,065 - subp.py[DEBUG]: Running command ['mount', '-o', 'ro', '-t', 'auto', '/dev/sr1', '/run/cloud-init/tmp/tmpb4d62dyf'] with allowed return codes [0] (shell=False, capture=True) 2022-05-26 10:51:35,825 - handlers.py[DEBUG]: finish: init-network/consume-user-data: SUCCESS: reading and applying user-data


So clearly something happens there. Nonetheless with boot commands listed above NO files are being downloaded from the addional iso file. Meaning that file: /var/lib/cloud/instances/nocloud/user-data.txt is EMPTY. If I do manually mount /dev/sr1 /mnt I can see my user-data.


Perhaps somehow mount the iso file with the GRUB cli and pointing the cloud-init to that? Certainly an option..
Will keep hacking..


More From » boot

 Answers
3

After a while the problem is solved.
The correct boot command is:


   `linux /casper/vmlinuz autoinstall quiet ---
initrd /casper/initrd
boot`

and installer looks for user-data file indeed automatically. Do not really understand why providing 'ds=' section brakes it entirely. All you need is to generate iso file with cidata label containing at least two common files the user-data and meta-data. Also the content of user-file differs from what we have been using in Ubuntu 20.04, some bugs are gone which is good. As of today (26.5.2022) the Ubuntu autoinstall docs is sufficient so as the cloud-init doc.


Thanks Andrew Lowther for good point.


[#648] Friday, November 18, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
fishutt

Total Points: 391
Total Questions: 137
Total Answers: 106

Location: Mexico
Member since Tue, Aug 11, 2020
4 Years ago
fishutt questions
Mon, Mar 28, 22, 15:09, 2 Years ago
Wed, Feb 8, 23, 06:50, 1 Year ago
Thu, Aug 25, 22, 13:26, 2 Years ago
Fri, Apr 22, 22, 00:08, 2 Years ago
Wed, May 26, 21, 00:38, 3 Years ago
;