Some comments:

a) Certainly doable, we do it for the non-cloud-init images. Fairly
straightforward for CPC to do. We don't do it today because cloud-init
does this everywhere else so it felt natural to let cloud-init do it.
One potential problem with doing it through the template is that the
user may want to set a hostname that's different from the container
name. So we'd first set the container name as the hostname and cloud-
init would then change it again to the name the user provided through
user-data.

If done this way, we'd mark the template as triggering on "create" and
"copy" so it'd only get templated on initial container creation or when
cloning the container. Those are the same conditions under which we
write the cloud-init seed data.


b) I think that's what folks expect cloud-init to do.

c) We will eventually do this, possibly this cycle still. However note
that this isn't a perfect solution either as again, the container name
and expected hostname may differ. This is most visible with nova-lxd
where the containers are all named instance-XYZ but the hostname in the
container is to be set to whatever the user wants.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1600766

Title:
  initial dhcp has default hostname of ubuntu

To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-init/+bug/1600766/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to