Comment 2 for bug 1339386

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

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

commit 65341b2547c5eedef720f6a6742cdfe436141907
Author: Rick Harris <email address hidden>
Date: Tue Jul 8 17:31:27 2014 -0500

    libvirt: Avoid Glance.show on hard_reboot

    When a Libvirt host is rebooted, we can optionally choose to automatically
    spin back up the instances using the `resume_state_on_host_boot` call. This,
    in turn, uses `_hard_reboot` to bring back the instances.

    The problem is that `_get_guest_xml` which `_hard_reboot` is using is always
    making a call to Glance.show since `image_meta` isn't being passed into it. In
    addition to this being an extra latency-heavy call, this is big problem
    because the request is *server-generated* not *user-generated* so we won't
    have the necessary user-request context to make the Glance call.

    In the absense of a general user-impersonation mechanism, the current
    workaround is to use cached image-metadata, which works in this case as well.

    So the fix is to pass that `image_meta` that we already pull from instance
    metadata in `_hard_reboot` and pass it into `_get_guest_xml` and thus avoid
    the extra request to Glance.

    Change-Id: I2203ac709405ee784ee5ec017aa475575a46a0df
    Closes-Bug: 1339386