Error Reasons being dropped in generic handler of _migrate_live

Bug #1250523 reported by moorryan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
moorryan

Bug Description

The reason detail of the Errors: MigrationPreCheckError, NoValidHost, InvalidSharedStorage and InvalidLocalStorage are being dropped by the generic error handler of the _migrate_live function in nova/api/openstack/compute/contrib/admin_actions.py

The class exceptions of MigrationPreCheckError, NoValidHost, InvalidSharedStorage and InvalidLocalStorage are defined as:
class MigrationPreCheckError(MigrationError):
    msg_fmt = _("Migration pre-check error") + ": %(reason)s"
class NoValidHost(NovaException):
    msg_fmt = _("No valid host was found. %(reason)s")
class InvalidSharedStorage(NovaException):
    msg_fmt = _("%(path)s is not on shared storage: %(reason)s")
class InvalidLocalStorage(NovaException):
    msg_fmt = _("%(path)s is not on local storage: %(reason)s")

When errors are raised they are raised with a formatted reason message:
e.g. 'Unable to migrate %(instance_uuid)s: '
                        'Disk of instance is too large(available'
                        ' on destination host:%(available)s '
                        '< need:%(necessary)s)').....

The generic Exception handler in _migrate_live does not include the reason in the error raised - so the detail does not get back up to the client
except Exception:
            if host is None:
                msg = _("Live migration of instance %s to another host "
                        "failed") % id
            else:
                msg = _("Live migration of instance %(id)s to host %(host)s "
                        "failed") % {'id': id, 'host': host}
            LOG.exception(msg)
            # Return messages from scheduler
            raise exc.HTTPBadRequest(explanation=msg)

Tags: api
Revision history for this message
moorryan (moorryan) wrote :

see: https://review.openstack.org/#/c/56049/2

Change-Id: I3d7e0626223f2606c5e7205e5022e26585506cfb

Changed in nova:
assignee: nobody → moorryan (moorryan)
Matt Riedemann (mriedem)
Changed in nova:
status: New → In Progress
tags: added: api
Revision history for this message
moorryan (moorryan) wrote :

see: https://review.openstack.org/#/c/56049/ - has four +1 and a tick (core reviewer) - just waiting for approval

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

Reviewed: https://review.openstack.org/56049
Committed: http://github.com/openstack/nova/commit/7c0cfd9c9974d029da9c389efa79f7105eb6c0a6
Submitter: Jenkins
Branch: master

commit 7c0cfd9c9974d029da9c389efa79f7105eb6c0a6
Author: Ryan Moore <email address hidden>
Date: Tue Nov 12 15:52:18 2013 +0000

    handle migration errors

    handle errors:
       MigrationPreCheckError, NoValidHost,
       InvalidSharedStorage and InvalidLocalStorage
    in _migrate_live so that the 'reason' is passed up

    Closes-Bug: 1250523

    Change-Id: I3d7e0626223f2606c5e7205e5022e26585506cfb

Changed in nova:
status: In Progress → Fix Committed
Changed in nova:
milestone: none → icehouse-1
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: icehouse-1 → 2014.1
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.