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