No bootable device when evacuate a instance on shared_storage_storage ceph

Bug #1635160 reported by sampsonhuo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
New
Undecided
Unassigned

Bug Description

Nova Verion:nova-kilo-2015.1.1
Ceph Verion:ceph version 10.2.2 (45107e21c568dd033c2f0a3107dec8f0b0e58374)

When i test nova evacuate function i found after the instance evacuated it cant not boot normally.
By the vnc console i see "No bootable device" info.

Through some tests i found the reason: when u used the shared storage the rebuild task flow will not get the image meta again. So if u set meta for the image, the problem occur.

The code:
 nova/compute/manager.py

 @object_compat
 @messaging.expected_exceptions(exception.PreserveEphemeralNotSupported)
 @wrap_exception()
 @reverts_task_state
 @wrap_instance_event
 @wrap_instance_fault
 def rebuild_instance(self, context, instance, orig_image_ref, image_ref,
   injected_files, new_pass,
      orig_sys_metadata,
   bdms, recreate, on_shared_storage,
   preserve_ephemeral=False):
    ......

if on_shared_storage != self.driver.instance_on_disk(instance):
  raise exception.InvalidSharedStorage(_("Invalid state of instance files on shared"
    " storage"))

if on_shared_storage:
  LOG.info(_LI('disk on shared storage, recreating using'
         ' existing disk'))
else:
  image_ref = orig_image_ref = instance.image_ref
  LOG.info(_LI("disk not on shared storage, rebuilding from:"
         " '%s'"), str(image_ref))

# NOTE(mriedem): On a recreate (evacuate), we need to update
# the instance's host and node properties to reflect it's
# destination node for the recreate.
node_name = None
try:
  compute_node = self._get_compute_info(context, self.host)
     node_name = compute_node.hypervisor_hostname
except exception.ComputeHostNotFound:
  LOG.exception(_LE('Failed to get compute_info for %s'),self.host)
finally:
  instance.host = self.host
  instance.node = node_name
  instance.save()

if image_ref:
  image_meta = self.image_api.get(context, image_ref)
else:
  image_meta = {}
......

Bellow is my image info
+------------------------------+--------------------------------------+
| Property | Value |
+------------------------------+--------------------------------------+
| OS-EXT-IMG-SIZE:size | 53687091200 |
| created | 2016-09-20T08:15:21Z |
| id | 8b218b4d-74ff-44af-bc4c-c37fb1106b03 |
| metadata hw_disk_bus | scsi |
| metadata hw_qemu_guest_agent | yes |
| metadata hw_scsi_model | virtio-scsi |
| minDisk | 0 |
| minRam | 0 |
| name | zptest-20160920 |
| progress | 100 |
| status | ACTIVE |
| updated | 2016-10-20T07:38:54Z |
+------------------------------+--------------------------------------+

Tags: evacuate
description: updated
description: updated
Revision history for this message
sampsonhuo (13261149612-5) wrote :

I found the same bug:
https://bugs.launchpad.net/nova/+bug/1562681

but in Kilo i update like this:

nova/compute/manager.py
the rebuild_instance function update from:

if on_shared_storage:
  LOG.info(_LI('disk on shared storage, recreating using'
         ' existing disk'))
else:
  image_ref = orig_image_ref = instance.image_ref
  LOG.info(_LI("disk not on shared storage, rebuilding from:"
         " '%s'"), str(image_ref))

to

  image_ref = orig_image_ref = instance.image_ref
  LOG.info(_LI("rebuilding from:'%s'"), str(image_ref))

Revision history for this message
Bing Li (libing863) wrote :

This bug seems duplicated with https://bugs.launchpad.net/nova/+bug/1562681, and has been fixe in Liberty and newer versions.

Sean Dague (sdague)
tags: added: evacuate
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.