dannf / ubuntu-server-netboot

Other
43 stars 9 forks source link

[Bug Report] --autoinstall-url not autoinstalling #24

Closed antiochtech closed 3 years ago

antiochtech commented 3 years ago

Description

--autoinstall-url not autoinstalling

{{ cookiecutter.project_name }} version

0.1.1

Steps to Reproduce

./ubuntu-server-netboot --iso ubuntu-20.04.2-live-server-amd64.iso --url http://172.16.1.254:50080/ubuntu-20.04.2-live-server-amd64.iso --autoinstall-url http://172.16.1.254:50080/

user-data:

#cloud-config
autoinstall:
  apt:
    geoip: true
    preserve_sources_list: false
    primary:
    - arches: [amd64, i386]
      uri: http://us.archive.ubuntu.com/ubuntu
    - arches: [default]
      uri: http://ports.ubuntu.com/ubuntu-ports
  identity: {hostname: myHost, password: $6$exDY1mhS4KUYCE/2$zmn9ToZwTKLhCw.b4/b.ZRTIZM30JZ4QrOQ2aOXJ8yk96xpcCof0kxKwuX1kqLG/ygbJ1f8wxED22bTL4F46P0,
    realname: myRealName, username: myUsername}
  keyboard: {layout: us, toggle: null, variant: ''}
  locale: en_US
  ssh:
    allow-pw: true
    authorized-keys: []
    install-server: true
  storage:
    layout:
      name: direct
  version: 1

Expected Behavior

installation should finish entirely unattended.

Actual Behavior

installation begins interactively, starting with language selection.

More Information

ubuntu-20.04.2-live-server-amd64.iso, user-data and an empty meta-data confirmed accessible.

ubuntu-installer/pxelinux.cfg/default:

DEFAULT install
LABEL install
  KERNEL casper/vmlinuz
  INITRD casper/initrd
  APPEND root=/dev/ram0 ramdisk_size=1500000 ip=dhcp url=http://172.16.1.254:50080/ubuntu-20.04.2-live-server-amd64.iso autoinstall "ds=nocloud-net;s=http://172.16.1.254:50080/" ---
antiochtech commented 3 years ago

from the first two lines of /var/log/clound-init.log:

2021-08-11 22:57:02,499 - util.py[DEBUG]: Cloud-init v. 20.4.1-0ubuntu1~20.04.1 running 'init-local' at Wed, 11 Aug 2021 22:57:02 +0000. Up 201.81 seconds.
2021-08-11 22:57:02,500 - main.py[INFO]: contents of 'http://172.16.1.254:50080/ubuntu-20.04.2-live-server-amd64.iso' did not start with b'#cloud-config'

appears to be looking for user-data at the --url parameter rather than the --autoinstall-url parameter?

antiochtech commented 3 years ago

can confirm from the web server's log that user-data and meta-data are not being accessed by the installer, just ubuntu-20.04.2-live-server-amd64.iso.

tai271828 commented 3 years ago

Hi @antiochtech , thank you for reporting.

I don't have a legacy machine on hand so I could not validate your issue (yet). According to the log, I agree with you. 2021-08-11 22:57:02,500 - main.py[INFO]: contents of 'http://172.16.1.254:50080/ubuntu-20.04.2-live-server-amd64.iso' did not start with b'#cloud-config', so I would say the boot parameter is not consumed correctly: cloud-init treated the iso as a user-data.

If the boot parameter is not consumed correctly, I will check the following items in order:

  1. syntax of your ubuntu-installer/pxelinux.cfg/default
  2. how does cloud-init consumes ubuntu-installer/pxelinux.cfg/default. Is the behavior expected?
  3. does user-data exist locally? This is just a double check because you have said user-data and meta-data are not accessed by the installer (this could happen if the parameter consumption of cloud-init goes wrong).
antiochtech commented 3 years ago

solved it! the problem lay in the double quotes around ds=nocloud-net;s=http://172.16.1.254:50080/. i dropped the quotes and the installer reads my user-data.

tai271828 commented 3 years ago

Thank you @antiochtech for updating. Your tip will definitely help the upcoming users in the future!