1

I would like to install ubuntu 22.04 automatically with the PXE. When using the "cloud-init" script the installation freezes on "connecting ..." with a looping animation "/-|/" (screen attached)

I don't know what is blocking and I can't find any error message in the logs

Can you help me and do you know what this "connecting" step does?

pxelinux.cfg/default

menu title Ubuntu installer

label jammy menu label Install Ubuntu Jammy (22.04) menu default kernel casper/vmlinuz initrd casper/initrd append root=/dev/ram0 ramdisk_size=1500000 ip=dhcp cloud-config-url=/dev/null url=http://192.168.42.151/jammy-live-server-amd64.iso autoinstall ds=nocloud-net;s=http://192.168.42.151/jammy/ # Don't forget the slash at the end.

prompt 0 timeout 0 default jammy

user-data

#cloud-config
autoinstall:
  identity:
    hostname: jammy-minimal
    password: $6$gnqbMUzHhQzpDEw.$.cCNVVDsDfj5Feebh.5O4VbOmib7tyjmeI2ZsFP7VK2kWwgJFbfjvXo3chpeAqCgXWVIW9oNQ/Ag85PR0IsKD/
    username: ubuntu
  version: 1

in the apache server logs I can see the client taking the iso, meta-data and user-data files

/var/log/apache2/access.log

192.168.42.152 - - [30/Jul/2022:09:28:21 +0000] "GET /jammy-live-server-amd64.iso HTTP/1.1" 200 1466714112 "-" "Wget"
192.168.42.152 - - [30/Jul/2022:09:28:30 +0000] "GET /jammy/meta-data HTTP/1.1" 200 - "-" "Cloud-Init/22.1-14-g2e17a0d6-0ubuntu1~22.04.5"
192.168.42.152 - - [30/Jul/2022:09:28:30 +0000] "GET /jammy/user-data HTTP/1.1" 200 674 "-" "Cloud-Init/22.1-14-g2e17a0d6-0ubuntu1~22.04.5"

On client /var/lib/cloud/data/result.json

{
 "v1": {
  "datasource": "DataSourceNoCloudNet [seed=cmdline,/var/lib/cloud/seed/nocloud,http://192.168.42.151/jammy/][dsmode=net]",
  "errors": []
 }
}

Screenshot

stuck_screenshot

Thanks for your help

  • Do you need to specify the port you are connecting on for s=http://192.168.42.151/jammy/ https://cloudinit.readthedocs.io/en/latest/topics/datasources/nocloud.html – iyrin Jul 30 '22 at 11:09
  • 1
    Thanks for your reply

    I use the standard http port. but I tried to be sure.

    It's the same result.

    I can see downloads of user-data and meta-data files in web server logs (/var/log/apache2/access.log)

    Extract of pxelinux.cfg/default

        append root=/dev/ram0 ramdisk_size=1500000 ip=dhcp cloud-config-url=/dev/null url=http://192.168.42.151/jammy-live-server-amd64.iso ds=nocloud-net;s=http://192.168.42.151:80/jammy/
    
    – Morphatrix Jul 31 '22 at 12:38

2 Answers2

1

It's amazing!!!

Thank you dummyuser for your help. With this line the automatic installation starts.

append root=/dev/ram0 ramdisk_size=1500000 autoinstall ip=dhcp cloud-config-url=http://192.168.42.151/jammy/user-data url=http://192.168.42.151/jammy-live-server-amd64.iso ds=nocloud-net;s=http://192.168.42.151/

The autoinstall option was used.
The cloud-config-url kernel argument setting /dev/null was replaced with the address and path to the /user/data file.


Pay attention to how /dev/null was being handled as described at Ubuntu automated installation:

cloud-config-url=/dev/null Workaround to download install media only once

See Running a truly automatic autoinstall:

Even if a fully noninteractive autoinstall config is found, the server installer will ask for confirmation before writing to the disks unless autoinstall is present on the kernel command line. This is to make it harder to accidentally create a USB stick that will reformat a machine it is plugged into at boot. Many autoinstalls will be done via netboot, where the kernel command line is controlled by the netboot config – just remember to put autoinstall in there!


I couldn't find after 2 weeks of troubleshooting. I can say that the problem solved.

Thanks a lot.

iyrin
  • 1,390
  • 15
  • 21
0

I had a similar issue some days ago when upgrading my PXE env from 20.04.3 to 20.04.4. 20.04.04 is the Version you use, too. (same size of iso) See

I think your user-data is a bit short, but as it is never loaded this is not the root error.

  • Does any Service fail during Boot (seen in console Boot log)?
  • please check the cloud-config-url in the append line this is new pointing now directly to the user-data file in my case. (with 20.04.3 it was /dev/null)
  • guess you do not have any errors in the tftplog (if you have a log) ?
dummyuser
  • 963
  • 1
  • 3
  • 10