← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1339386] [NEW] Reboot should not require a Glance.show

 

Public bug reported:

When a host is rebooted, we use `resume_state_on_host_boot` to spin back
up the instances.

In `libvirt` this translates to a bunch of `_hard_reboot` calls.

The problem is that, `_hard_reboot` calls `_get_guest_xml`, which then
calls `get_image_metadata` (since no `image_meta` is passed in). This in
turn triggers a call to `glance.show` which will fail.

The reason the call will fail is that, the glanceclient needs user-
credentials in order to make this call, but since we're a server-side
triggered action (host rebooting), we don't have a user-request context.

At a high-level, this is an issue of user-impersonation for server-side-
triggered actions, which we don't have good story for yet.

We do, however, have a work around for this particular case.

We can use the cached image_metadata that we store with the instance.

In fact `_hard_reboot` is already using it, so we just need to pass that
`image_meta` into `_get_guest_xml` and it will work.

** Affects: nova
     Importance: Undecided
     Assignee: Rick Harris (rconradharris)
         Status: In Progress

** Changed in: nova
     Assignee: (unassigned) => Rick Harris (rconradharris)

** Changed in: nova
       Status: New => In Progress

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1339386

Title:
  Reboot should not require a Glance.show

Status in OpenStack Compute (Nova):
  In Progress

Bug description:
  When a host is rebooted, we use `resume_state_on_host_boot` to spin
  back up the instances.

  In `libvirt` this translates to a bunch of `_hard_reboot` calls.

  The problem is that, `_hard_reboot` calls `_get_guest_xml`, which then
  calls `get_image_metadata` (since no `image_meta` is passed in). This
  in turn triggers a call to `glance.show` which will fail.

  The reason the call will fail is that, the glanceclient needs user-
  credentials in order to make this call, but since we're a server-side
  triggered action (host rebooting), we don't have a user-request
  context.

  At a high-level, this is an issue of user-impersonation for server-
  side-triggered actions, which we don't have good story for yet.

  We do, however, have a work around for this particular case.

  We can use the cached image_metadata that we store with the instance.

  In fact `_hard_reboot` is already using it, so we just need to pass
  that `image_meta` into `_get_guest_xml` and it will work.

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1339386/+subscriptions


Follow ups

References