Renaming Instance Name doesn't change hostname on a Rebuild

Bug #1068154 reported by Antony Messerli on 2012-10-18
98
This bug affects 17 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Wishlist
Unassigned

Bug Description

Renaming an instance name via novaclient only changes the display_name, it doesn't actually update the hostname or display_description in the instances table.

This means if I want to change the name of an instance, and then rebuild it, it will utilize the original name as set in hostname.

Renaming an instance name should also update the other fields.

summary: - Renaming Instance Name doesn't change hostname
+ Renaming Instance Name doesn't change hostname on a Rebuild
Vish Ishaya (vishvananda) wrote :

display_description should stay as it can be updated separately, but updating name should update hostname using the same logic that creating a server does.

We may need to add a new codepath if we want the name changed in dnsmasq as well.

Changed in nova:
status: New → Confirmed
importance: Undecided → Medium
tags: added: low-hanging-fruit
Rongze Zhu (zrzhit) on 2012-10-23
Changed in nova:
assignee: nobody → Rongze Zhu (zrzhit)
Rongze Zhu (zrzhit) on 2012-10-23
Changed in nova:
assignee: Rongze Zhu (zrzhit) → nobody
Shuquan Huang (shuquan) on 2012-11-16
Changed in nova:
assignee: nobody → Shuquan Huang (spring1201)
assignee: Shuquan Huang (spring1201) → nobody
Shuquan Huang (shuquan) on 2012-11-29
Changed in nova:
assignee: nobody → Shuquan Huang (spring1201)
status: Confirmed → In Progress
Rohit Karajgi (rohitk) on 2013-05-17
Changed in nova:
assignee: Shuquan Huang (spring1201) → Rohit Karajgi (rohitkarajgi)
Rohit Karajgi (rohitk) on 2013-09-17
Changed in nova:
assignee: Rohit Karajgi (rohitkarajgi) → nobody
sachi (sachi-gupta) on 2013-09-26
Changed in nova:
assignee: nobody → sachi (sachi-gupta)
sachi (sachi-gupta) on 2013-10-14
Changed in nova:
status: In Progress → Fix Committed
status: Fix Committed → Opinion
status: Opinion → Fix Committed
Thierry Carrez (ttx) wrote :

Could you point to the commit that actually fixes this ?

Changed in nova:
status: Fix Committed → In Progress
sachi (sachi-gupta) on 2013-11-11
Changed in nova:
assignee: sachi (sachi-gupta) → nobody
Changed in nova:
assignee: nobody → Sumanth Nagadavalli (sumanth-nagadavalli)

The bug description is still seen. Assigning it to myself.

Is the expected behavior just to update the other fields (hostname, display_description) in instances table? Or should it also change the hostname inside the vm?

Scott Adkins (adkinss) wrote :

My preference would be to see a renamed VM only update the hostname and display_name fields and NOT the display_description field. Also, I would not expect Nova to make changes inside a VM after it has been built. What I would expect is that when a VM is rebuilt, the new hostname would be applied to that VM and not the original hostname. I did some testing in a Havana environment and found that updating the hostname field in addition to display_name seems to fix the bug just fine.

Neill Cox (neillc) on 2014-06-12
Changed in nova:
assignee: Sumanth Nagadavalli (sumanth-nagadavalli) → Neill Cox (neillc)
Sean Dague (sdague) wrote :

Patch stalled

Changed in nova:
status: In Progress → Confirmed
assignee: Neill Cox (neillc) → nobody

Change abandoned by Sean Dague (<email address hidden>) on branch: master
Review: https://review.openstack.org/100125
Reason: This review is > 4 weeks without comment, and failed Jenkins the last time it was checked. We are abandoning this for now. Feel free to reactivate the review by pressing the restore button and leaving a 'recheck' comment to get fresh test results.

Changed in nova:
assignee: nobody → Chris Gacsal (chris-gacsal)
Changed in nova:
status: Confirmed → In Progress

Removing "In Progress" status

as there is no pending review

Changed in nova:
status: In Progress → Confirmed
Chris Gacsal (chris-gacsal) wrote :

I have recently started to work on this bug and going to reopen the Neill's abandoned patchset.

Changed in nova:
status: Confirmed → In Progress

Change abandoned by Michael Still (<email address hidden>) on branch: master
Review: https://review.openstack.org/170130
Reason: This patch has been stalled for quite a while, so I am going to abandon it to keep the code review queue sane. Please restore the change when it is ready for review.

description: updated
Changed in nova:
assignee: Chris Gacsal (chris-gacsal) → Vinod (vinodm-mangalore27)
assignee: Vinod (vinodm-mangalore27) → nobody
assignee: nobody → Vinod (vinodm-mangalore27)
Changed in nova:
assignee: Vinod (vinodm-mangalore27) → nobody
Changed in nova:
assignee: nobody → SURAJ KUMAR G R (surajkumarr12)

No updates since 02/26

Changed in nova:
status: In Progress → Confirmed
assignee: SURAJ KUMAR G R (surajkumarr12) → nobody
Tracy Jones (tjones-i) wrote :

i'll rebase this patch and give it a shot

Changed in nova:
assignee: nobody → Tracy Jones (tjones-i)
Tracy Jones (tjones-i) wrote :

I just retested this on upstream master (devstack) and it worked. The steps I took are

1. create an instance
2. change the name
3. rebuild

the changed name were still there after the rebuild. Did you do some other steps? If not, this may have been fixed by a subsequent patch

Changed in nova:
status: Confirmed → Incomplete
assignee: Tracy Jones (tjones-i) → nobody
ZhaoHangbo (497492840-9) on 2016-03-08
Changed in nova:
assignee: nobody → ZhaoHangbo (497492840-9)
assignee: ZhaoHangbo (497492840-9) → nobody
kavya (aravapalli-kavya) on 2016-03-21
Changed in nova:
assignee: nobody → kavya (aravapalli-kavya)
kavya (aravapalli-kavya) on 2016-03-21
Changed in nova:
assignee: kavya (aravapalli-kavya) → nobody
Matt Riedemann (mriedem) wrote :

Per comment 15, I don't think that's what the bug is saying, or requesting. Yes you can rename the instance and rebuild it and the new instance has the same display_name, but the hostname is not changed, and is the same as the original instance, I've recreated with a newton devstack:

http://paste.openstack.org/show/494464/

The question is if we should rename the hostname in the guest when rebuilding it. Maybe that needs to be a parameter on the rebuild API since we preserve the IP network settings and storage for the instance through the rebuild, so changing the hostname could mess with anything that's relying on that to be unchanged through the rebuild.

Matt Riedemann (mriedem) wrote :

Note in my recreate that the nic doesn't change:

2001:db8::7, 172.24.4.6

So I think changing the hostname during rebuild, at least by default, is wrong.

Changed in nova:
status: Incomplete → Opinion
Matt Riedemann (mriedem) wrote :

Melanie Witt also makes good points in the old review https://review.openstack.org/#/c/170130/:

melanie witt
May 5, 2015

Patch Set 5: Code-Review-1

The weird thing about this is, it allows one to update the "hostname" of the instance before it is actually using that hostname (and may potentially never use it, if it is never rebuilt). I was also concerned whether the guest will actually consume the hostname from metadata again when rebuilt. I assume from your patch that it does, since virt domain is destroyed and recreated during a rebuild.

Also mentioned in the bug report, what about updating in dnsmasq? Point being, I don't think updating the hostname is as simple and would take more work to change it in the db, make the guest take the new name (without a rebuild or anything), update it in dnsmasq, etc.

--

So I think this is definitely a bigger API change and would require a spec to consider the impact of a change in behavior like this.

See https://specs.openstack.org/openstack/nova-specs/readme.html for submitting a spec.

Changed in nova:
importance: Medium → Wishlist
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers