canonical / cloud-init

Official upstream for the cloud-init: cloud instance initialization
https://cloud-init.io/
Other
2.88k stars 857 forks source link

Cloud-init inject hostname should support dot and without .novalocal #3221

Closed ubuntu-server-builder closed 1 year ago

ubuntu-server-builder commented 1 year ago

This bug was originally filed in Launchpad as LP: #1786744

Launchpad details
affected_projects = []
assignee = None
assignee_name = None
date_closed = 2018-10-20T04:18:28.728552+00:00
date_created = 2018-08-13T08:17:34.152517+00:00
date_fix_committed = None
date_fix_released = None
id = 1786744
importance = undecided
is_complete = True
lp_url = https://bugs.launchpad.net/cloud-init/+bug/1786744
milestone = None
owner = sibiaoluo
owner_name = Sibiao Luo
private = False
status = expired
submitter = sibiaoluo
submitter_name = Sibiao Luo
tags = []
duplicates = []

Launchpad user Sibiao Luo(sibiaoluo) wrote on 2018-08-13T08:17:34.152517+00:00

Description of problem: Cloud-init inject hostname should support dot and without .novalocal.

Version-Release number of selected component (if applicable): cloud-init 0.7.9

How reproducible: 100%

Steps to Reproduce: 1.create a RHEL7.5/7.4 instance specified the hostname with OpenStack API 2.login VM with hostnamectl to check the hostname

Actual results: API: hostname=ecs-rhel7.4-instance --------> VM: hostname=ecs-rhel7.novanoval API: hostname=ecs-rhel74-instance --------> VM: ecs-rhel74-instance.novanoval

Expected results: The VM hostname is the same as specified in OpenStack API or ECS Console.

Additional info:

diff init.py

usr/lib/python2.7/site-packages/cloudinit/sources/init.py 205c205 < toks = lhost.split(".novalocal")

            toks = lhost.split(".")

209c209 < #domain = '.'.join(toks[1:])

        domain = '.'.join(toks[1:])
ubuntu-server-builder commented 1 year ago

Launchpad user Scott Moser(smoser) wrote on 2018-08-17T18:33:53.981625+00:00

Hi, Could you please test to see if this is still a problem with trunk?

We have daily copr builds at https://copr.fedorainfracloud.org/coprs/g/cloud-init/cloud-init-dev/

Please test with the builds there and report back.

If it is still a problem, please attach the output of 'cloud-init collect-logs'.

After you've done so, please set the status to 'Confirmed'.

Thanks.

ubuntu-server-builder commented 1 year ago

Launchpad user Sibiao Luo(sibiaoluo) wrote on 2018-08-20T04:11:35.796005+00:00

Try this: https://copr-be.cloud.fedoraproject.org/results/%40cloud-init/cloud-init-dev/epel-7-x86_64/00788016-cloud-init/cloud-init-18.3+24.gf6249277-1.el7.noarch.rpm

It support donot now, but still append the .novalocal problem.

You shoud split it by .novalocal which can make success.

diff init.py

usr/lib/python2.7/site-packages/cloudinit/sources/init.py 205c205 < toks = lhost.split(".novalocal")

toks = lhost.split(".") 209c209 < #domain = '.'.join(toks[1:])

domain = '.'.join(toks[1:])

ubuntu-server-builder commented 1 year ago

Launchpad user Sibiao Luo(sibiaoluo) wrote on 2018-08-20T06:10:38.748631+00:00

Launchpad attachments: aaaa.pngloud-init-18.3+24.gf6249277-1.el7 test result

ubuntu-server-builder commented 1 year ago

Launchpad user Sibiao Luo(sibiaoluo) wrote on 2018-08-20T06:10:41.650570+00:00

ubuntu-server-builder commented 1 year ago

Launchpad user Scott Moser(smoser) wrote on 2018-08-20T18:22:50.663592+00:00

Hi, can you please attach the output of 'cloud-init collect-logs'.

Thank you. Scott

ubuntu-server-builder commented 1 year ago

Launchpad user Launchpad Janitor(janitor) wrote on 2018-10-20T04:18:28.603224+00:00

[Expired for cloud-init because there has been no activity for 60 days.]