Renaming Instance Name doesn't change hostname on a Rebuild

Bug #1068154 reported by Antony Messerli
102
This bug affects 18 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Opinion
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
Revision history for this message
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)
Changed in nova:
assignee: nobody → Rongze Zhu (zrzhit)
Rongze Zhu (zrzhit)
Changed in nova:
assignee: Rongze Zhu (zrzhit) → nobody
Shuquan Huang (shuquan)
Changed in nova:
assignee: nobody → Shuquan Huang (spring1201)
assignee: Shuquan Huang (spring1201) → nobody
Shuquan Huang (shuquan)
Changed in nova:
assignee: nobody → Shuquan Huang (spring1201)
status: Confirmed → In Progress
Rohit Karajgi (rohitk)
Changed in nova:
assignee: Shuquan Huang (spring1201) → Rohit Karajgi (rohitkarajgi)
Rohit Karajgi (rohitk)
Changed in nova:
assignee: Rohit Karajgi (rohitkarajgi) → nobody
sachi (sachi-gupta)
Changed in nova:
assignee: nobody → sachi (sachi-gupta)
sachi (sachi-gupta)
Changed in nova:
status: In Progress → Fix Committed
status: Fix Committed → Opinion
status: Opinion → Fix Committed
Revision history for this message
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)
Changed in nova:
assignee: sachi (sachi-gupta) → nobody
Changed in nova:
assignee: nobody → Sumanth Nagadavalli (sumanth-nagadavalli)
Revision history for this message
Sumanth Nagadavalli (sumanth-nagadavalli) wrote :

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?

Revision history for this message
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)
Changed in nova:
assignee: Sumanth Nagadavalli (sumanth-nagadavalli) → Neill Cox (neillc)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/100125

Revision history for this message
Sean Dague (sdague) wrote :

Patch stalled

Changed in nova:
status: In Progress → Confirmed
assignee: Neill Cox (neillc) → nobody
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

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
Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote :

Removing "In Progress" status

Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote :

as there is no pending review

Changed in nova:
status: In Progress → Confirmed
Revision history for this message
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
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/170130

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

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)
Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote :

No updates since 02/26

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

i'll rebase this patch and give it a shot

Changed in nova:
assignee: nobody → Tracy Jones (tjones-i)
Revision history for this message
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)
Changed in nova:
assignee: nobody → ZhaoHangbo (497492840-9)
assignee: ZhaoHangbo (497492840-9) → nobody
kavya (aravapalli-kavya)
Changed in nova:
assignee: nobody → kavya (aravapalli-kavya)
kavya (aravapalli-kavya)
Changed in nova:
assignee: kavya (aravapalli-kavya) → nobody
Revision history for this message
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.

Revision history for this message
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
Revision history for this message
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  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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