Libvirt live migration fails when graphics listen is not 0.0.0.0 ("Cannot assign requested address")

Bug #1279563 reported by Solly Ross
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Committed
Medium
Solly Ross

Bug Description

Currently, live migration with the libvirt driver ("true" or otherwise) is only supported when the graphics listen addresses (vncserver_listen and spice.server_listen) are set to 0.0.0.0. If the addresses are set to the actual IP address of each compute host on the relevant machine, the migration fails, with libvirt giving the error "Cannot assign requested address".

This is because, post migration, libvirt is trying to rebind the listen address of the source machine, but since the VM is now on the destination machine, this is not possible.

Tags: libvirt
Revision history for this message
jichenjc (jichenjc) wrote :

I did see someone submitted a patch for this about 1 month before but I can't remember the exact number
maybe someone knows how to search can find it and its status

Revision history for this message
Solly Ross (sross-7) wrote :

 I posted the a fix here (the commit message hook didn't seem to work, for some reason): https://review.openstack.org/#/c/73428/. It's currently under review/investigation for some odd issues regarding libvirt treatment of XML.

tags: added: libvirt
Solly Ross (sross-7)
Changed in nova:
assignee: nobody → Solly Ross (sross-7)
Solly Ross (sross-7)
Changed in nova:
status: New → In Progress
importance: Undecided → Medium
Revision history for this message
Jay Lee (hyangii) wrote :

Why you use an actual ip address for vnc? 0.0.0.0 could refer to every host easily.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/73428
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=ea7da5152cdca7ba674e2137c3899909995e2287
Submitter: Jenkins
Branch: master

commit ea7da5152cdca7ba674e2137c3899909995e2287
Author: Solly Ross <email address hidden>
Date: Tue Feb 4 14:27:51 2014 -0500

    Change listen address on libvirt live-migration

    Previously, in order for libvirt live migration to work,
    the graphics listen addresses (VNC and/or Spice) had to be
    set on both machines to be 0.0.0.0 or ::. This was because libvirt
    would try to rebind to the source address on the destination
    machine, but would fail due to the source machine already having
    that address (this would not happen for 0.0.0.0 or ::, however).

    Now, a modified copy of the instance's XML is passed to libvirt's
    migrate function, such that the listen addresses are that of the
    destination machine. The addresses are stashed in the pre-migration
    data by the destination pre-migration method.

    Note that this functionality will only work on versions of libvirt
    with the VIR_DOMAIN_XML_MIGRATABLE flag. If the flag is not detected
    (anything vanilla libvirt less than 1.0.0), the live migration code
    will fall back to the old method.

    Fixes: bug #1279563

    Change-Id: I6c9500283027193179c11d18ad4242e165a9ad6e

Changed in nova:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to nova (master)

Reviewed: https://review.openstack.org/123811
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=867bdedf81533f283aae4de4488d54c254bb7f07
Submitter: Jenkins
Branch: master

commit 867bdedf81533f283aae4de4488d54c254bb7f07
Author: Matt Riedemann <email address hidden>
Date: Wed Sep 24 11:21:59 2014 -0700

    Fallback to legacy live migration if config error

    Commit ea7da5152cdca7ba674e2137c3899909995e2287 added a path to using
    migrateToURI2 for live migration if the version of libvirt used has the
    VIR_DOMAIN_XML_MIGRATABLE flag set.

    However, a bug in older versions of libvirt causes the live migration to
    fail because it's incorrectly validating the old and new domain xml's
    for ABI stability.

    Not all distros are running with the patched version of libvirt so add a
    check in place such that if we fail live migration on the new path with
    VIR_ERR_CONFIG_UNSUPPORTED, assume it's due to this issue and attempt
    the legacy migrateToURI call.

    Closes-Bug: #1362929
    Related-Bug: #1279563

    Change-Id: Ie82566121c2ed3a6d55919bc111358f4129cb404

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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