initial dhcp has default hostname of ubuntu
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical Juju |
Invalid
|
Medium
|
Unassigned | ||
cloud-init |
Won't Fix
|
Low
|
Unassigned | ||
cloud-init (Ubuntu) |
Won't Fix
|
Low
|
Unassigned |
Bug Description
When using the normal lxd-bridge, using a dnsmasq instance for dhcp, the initial dhcp is always the hostname 'ubuntu', and this is recorded in the dnsmasq's dhcp leases file.
Presumably the dhcp is done before the container's hostname is set. A restart or dhcp renew seems to put the correct container name in the leases file.
This is a problem when using the dnsmasq for local dns resolving for *.lxd, which is the standard way of doing host dns for containers, as new containers are not dns addressable without a restart or renew.
Is there anyway get the correct hostname in the initial dhcp? Or maybe renew after setting the hostname?
Related Bugs:
* LXC/LXD Issue https:/
description: | updated |
description: | updated |
Changed in cloud-init: | |
status: | New → Confirmed |
importance: | Undecided → Low |
Changed in cloud-init (Ubuntu): | |
importance: | Undecided → Low |
Changed in juju: | |
status: | New → Triaged |
importance: | Undecided → Medium |
Changed in cloud-init (Ubuntu): | |
status: | Confirmed → Won't Fix |
Changed in cloud-init: | |
status: | Confirmed → Won't Fix |
LXD doesn't set the hostname (well, it sets the kernel utsname but that's overridden by the hostname).
Instead LXD just feeds metadata to cloud-init which is then responsible for setting the hostname.
The problem is that cloud-init runs after network was brought up, so the hostname is incorrect at the time of the initial dhcp request.
A container reboot solves it, so would cloud-init setting the hostname before network is brought up or so would systemd re-starting the dhcp client after changing the hostname.
It could be that some of this problem is somehow resolved with recent cloud-init and the network config code but I'm sure Scott can tell us for sure :)