live migration fails when use long hostname of a nova compute target host

Bug #1310340 reported by Michael Kazakov
32
This bug affects 4 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Invalid
Wishlist
Unassigned
nova (Ubuntu)
Invalid
Wishlist
Unassigned

Bug Description

Nova don't do live-migration when used long hostname of target host

nova show ubuntu14.04
+--------------------------------------+-----------------------------------------------------------+
| Property | Value |
+--------------------------------------+-----------------------------------------------------------+
..................................................................................................................................
| OS-EXT-SRV-ATTR:host | compute2 |
| OS-EXT-SRV-ATTR:hypervisor_hostname | compute2.site.local |
..................................................................................................................................

nova live-migration ubuntu14.04 compute2.site.local
ERROR (BadRequest): Compute service of compute2.site.local is unavailable at this time. (HTTP 400) (Request-ID: req-f344c0bf-aaa3-47e6-a24c-8f37e89858e4)

but
nova live-migration ubuntu14.04 compute2
runs without error

Also if you try to do migration through horizon it always fails because horizon use long hostname fo target host.

Tracy Jones (tjones-i)
tags: added: compute
melanie witt (melwitt)
tags: added: api
removed: compute
Changed in nova:
assignee: nobody → Melanie Witt (melwitt)
importance: Undecided → Medium
status: New → Confirmed
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/101096

Changed in nova:
status: Confirmed → In Progress
Revision history for this message
jiang, yunhong (yunhong-jiang) wrote :

I'd think we should change the horizon to use host, instead of long hostname, or, if we really want to support target at specific one specific compute node, specify host/hypervisor_hostname?

--jyh

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in horizon (Ubuntu):
status: New → Confirmed
Revision history for this message
Julie Pichon (jpichon) wrote :

There's a Horizon patch up for changing the host name horizon is using (see bug 1335999 / https://review.openstack.org/#/c/103672/ ) though it's unclear to me if this will help with resolving this as well?

Revision history for this message
melanie witt (melwitt) wrote :

@Julie Thanks for linking the Horizon bug and review. That one will solve the problem of live migrate not working at all through Horizon, and it's anyway preferred to provide service host name. It won't however change the fact that we can't use hypervisor_hostname as a migration target argument. In the review of my patch, Yunhong pointed out that there isn't a unique constraint on hypervisor_hostname the way there is on service host name. But, in my patch I re-raise if more than one host is returned when I filter on hypervisor_hostname, so I think it should be okay i.e. it's better than nothing, at least we try.

@Yunhong What do you think? I was thinking also instead of re-raising I could raise something like "multiple targets found, use service host name."

Revision history for this message
marvel (marvelliu) wrote :

Yes, I met this problem, horizon give me nodes like "node1.expr", while the database has only "node1", causing live migration failure, a little fix is listed below:

 50 def populate_host_choices(self, request, initial):
 51 hosts = initial.get('hosts')
 52 current_host = initial.get('current_host')
 53 +host_list = [(host.service['host'],
 54 + host.service['host'])
 55 + for host in hosts
 56 + if host.service['host'] != current_host]
 57 -host_list = [(host.hypervisor_hostname,
 58 - host.hypervisor_hostname)
 59 - for host in hosts
 60 - if host.service['host'] != current_host]
 61 if host_list:
 62 host_list.insert(0, ("", _("Select a new host")))

Revision history for this message
melanie witt (melwitt) wrote :

This isn't really a bug, changing to Wishlist.

Changed in nova:
importance: Medium → Wishlist
status: In Progress → Confirmed
no longer affects: horizon
Revision history for this message
melanie witt (melwitt) wrote :

Removing horizon as it has its own bug and patch up for this bug 1335999

Revision history for this message
melanie witt (melwitt) wrote :

I lack permission to remove horizon (Ubuntu), so moving back to New.

Changed in horizon (Ubuntu):
status: Confirmed → New
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by melanie witt (<email address hidden>) on branch: master
Review: https://review.openstack.org/101096

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Chuck Short (zulcss)
affects: horizon (Ubuntu) → nova (Ubuntu)
Changed in nova (Ubuntu):
status: New → Confirmed
melanie witt (melwitt)
Changed in nova:
assignee: melanie witt (melwitt) → nobody
James Page (james-page)
Changed in nova (Ubuntu):
status: New → Triaged
importance: Undecided → Wishlist
tags: added: live-migrate
Revision history for this message
Adam Spiers (adam.spiers) wrote :

Hi Melanie, just wondering why this change was abandoned? Unless I misunderstood, it seemed that the only objections to Patch Set 4 were regarding implementation details, not against the approach. Your way of guarding against accidentally using the wrong non-unique hypervisor host seems good to me, but maybe I'm missing something? Thanks!

Paul Murray (pmurray)
tags: added: live-migration
removed: live-migrate
lvmxh (shaohef)
Changed in nova:
assignee: nobody → lvmxh (shaohef)
lvmxh (shaohef)
Changed in nova:
assignee: lvmxh (shaohef) → nobody
Changed in nova:
assignee: nobody → Maciej Szankin (mszankin)
Revision history for this message
Maciej Szankin (mszankin) wrote :

First thing - title is confusing. Problem is not in hostname length that is provided as target in live-migration command. Maximum hostname length is 64, and verified, it works.

Second thing - providing FQDN (which usually is used for hypervisor hostname) in live migration does not work by design. I am not sure if anyone is interested in being able to give FQDNs instead of hostnames as targets of LM.

Despite above:
There was a small possibility that by changing rabbit host in nova.conf from IP to FQDN this would be fixed, but verified it, didn't work.

I think that item is invalid, but someone has to agree with me.

Changed in nova:
status: Confirmed → Invalid
Changed in nova:
assignee: Maciej Szankin (mszankin) → nobody
Chuck Short (zulcss)
Changed in nova (Ubuntu):
status: Triaged → Invalid
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

Bug attachments

Remote bug watches

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