'Handle deletion if the instance has not reached a cell yet
Deletion before an instance reaches a cell needs to be handled
differently. What we\'re attempting to do is delete the BuildRequest
before the api level conductor does.  If we succeed here then the boot
request stops before reaching a cell.  If not then the instance will
need to be looked up in a cell db and the normal delete path taken.'

def _delete_while_booting(self, context, instance):

    deleted = self._attempt_delete_of_buildrequest(context, instance)
    service_version = objects.Service.get_minimum_version(context, 'nova-osapi_compute')
    if (service_version < 15):
        return False
    if deleted:
        try:
            instance_uuid = instance.uuid
            (cell, instance) = self._lookup_instance(context, instance_uuid)
            if (instance is not None):
                if cell:
                    with nova_context.target_cell(context, cell) as cctxt:
                        with compute_utils.notify_about_instance_delete(self.notifier, cctxt, instance):
                            instance.destroy()
                else:
                    instance.destroy()
        except exception.InstanceNotFound:
            pass
        return True
    return False
