live desktop system booted with ip=dhcp has the right lease, hostname not set at all

Bug #1920933 reported by eoli3n
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
initramfs-tools (Ubuntu)
New
Undecided
Unassigned
netplan.io (Ubuntu)
Invalid
Undecided
Unassigned
systemd (Ubuntu)
New
Undecided
Unassigned

Bug Description

Here the cmdline:

vmlinuz initrd=initrd rootfstype=nfs netboot=nfs nfsroot=162.38.151.26:/exports/focal-desktop boot=casper ip=dhcp fsck.mode=skip automatic-ubiquity url=http://162.38.151.26/preseed/fds/focal-efi.seed

File /run/systemd/netif/leases/2:

# This is private data. Do not parse.
ADDRESS=162.38.80.32
NETMASK=255.255.248.0
ROUTER=162.38.80.1
SERVER_ADDRESS=162.38.87.254
NEXT_SERVER=162.38.151.26
T1=7200
T2=12600
LIFETIME=14400
DNS=162.38.151.23 162.38.151.24
NTP=193.51.157.3
DOMAINNAME=fdsetu.infra.domain.fr
DOMAIN_SEARCH_LIST=infra.domain.fr fdsetu.infra.domain.fr
HOSTNAME=focal-uefi
CLIENTID=0152540071e1f2

But the hostname is still the default one "ubuntu"

$ hostnamectl
 Static hostname: ubuntu
       Icon name: computer-vm
         Chassis: vm
      Machine ID: cbb8d889829d4e2594ab55a53749e7e9
         Boot ID: c93c8cc26fa040f6b010077e676bf7ec
  Virtualization: kvm
Operating System: Ubuntu 20.04.2 LTS
          Kernel: Linux 5.8.0-43-generic
    Architecture: x86-64

It should be "focal-uefi".
I had the same issue with ubuntu server autoinstall

See https://bugs.launchpad.net/subiquity/+bug/1905932

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: systemd 245.4-4ubuntu3.4
ProcVersionSignature: Ubuntu 5.8.0-43.49~20.04.1-generic 5.8.18
Uname: Linux 5.8.0-43-generic x86_64
NonfreeKernelModules: zfs zunicode zavl icp zcommon znvpair
ApportVersion: 2.20.11-0ubuntu27.16
Architecture: amd64
CasperVersion: 1.445.1
Date: Tue Mar 23 15:30:42 2021
LiveMediaBuild: Ubuntu 20.04.2.0 LTS "Focal Fossa" - Release amd64 (20210209.1)
Lsusb:
 Bus 001 Device 002: ID 0627:0001 Adomax Technology Co., Ltd QEMU USB Tablet
 Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
 Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
 Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
 Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Lsusb-t:
 /: Bus 04.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
 /: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
 /: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
 /: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/6p, 480M
     |__ Port 1: Dev 2, If 0, Class=Human Interface Device, Driver=usbhid, 480M
MachineType: QEMU Standard PC (Q35 + ICH9, 2009)
ProcEnviron:
 TERM=linux
 PATH=(custom, no user)
 LANG=C.UTF-8
 SHELL=/bin/bash
ProcKernelCmdLine: vmlinuz initrd=initrd rootfstype=nfs netboot=nfs nfsroot=162.38.151.26:/exports/focal-desktop boot=casper ip=dhcp fsck.mode=skip automatic-ubiquity url=http://162.38.151.26/preseed/fds/focal-efi.seed
SourcePackage: systemd
SystemdDelta:
 [EXTENDED] /usr/lib/systemd/system/rc-local.service → /usr/lib/systemd/system/rc-local.service.d/debian.conf
 [EXTENDED] /usr/lib/systemd/system/user@.service → /usr/lib/systemd/system/user@.service.d/timeout.conf

 2 overridden configuration files found.
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 02/06/2015
dmi.bios.release: 0.0
dmi.bios.vendor: EFI Development Kit II / OVMF
dmi.bios.version: 0.0.0
dmi.chassis.type: 1
dmi.chassis.vendor: QEMU
dmi.chassis.version: pc-q35-3.1
dmi.modalias: dmi:bvnEFIDevelopmentKitII/OVMF:bvr0.0.0:bd02/06/2015:br0.0:svnQEMU:pnStandardPC(Q35+ICH9,2009):pvrpc-q35-3.1:cvnQEMU:ct1:cvrpc-q35-3.1:
dmi.product.name: Standard PC (Q35 + ICH9, 2009)
dmi.product.version: pc-q35-3.1
dmi.sys.vendor: QEMU

Revision history for this message
eoli3n (eoli3neoli3n) wrote :
Revision history for this message
Dimitri John Ledkov (xnox) wrote :
Revision history for this message
Benjamin Drung (bdrung) wrote :

initramfs-tools >= 0.142ubuntu5 (in mantic) has the qemu-net autopkgtest that covers this use case and it checks that the hostname is set correctly.

Does your initramfs comes without /etc/hostname?

Revision history for this message
Lukas Märdian (slyon) wrote :

Netplan is not involved with setting the hostname at all. Marking invalid for that package.

Changed in netplan.io (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.