[openstack-dev] [nova] [ocata] nova-api error 404 instance not found

Matt Riedemann mriedemos at gmail.com
Wed Oct 11 16:46:47 UTC 2017


On 10/11/2017 3:48 AM, Kim-Norman Sahm wrote:
> Hi Matt,
> 
> i'm using the ubuntu packages v15.0.6
> the instances are mapped to the correct cell:
> 
> mysql> select * from nova_api.instance_mappings where instance_uuid =
>      -> "e564c631-896c-458c-93ab-b1c88f444fff";
> +---------------------+---------------------+-----+------------------
> --------------------+---------+----------------------------------+
> | created_at          | updated_at          | id  |
> instance_uuid                        | cell_id |
> project_id                       |
> +---------------------+---------------------+-----+------------------
> --------------------+---------+----------------------------------+
> | 2017-10-10 08:16:32 | 2017-10-10 08:16:32 | 846 | e564c631-896c-458c-
> 93ab-b1c88f444fff |       6 | 7c1dd7d33037481e81f55d2f5d45bb90 |
> +---------------------+---------------------+-----+------------------
> --------------------+---------+----------------------------------+
> 
> I've tried the workaround of this bug:
> https://bugs.launchpad.net/nova/+bug/1682423
> 
> and its running correctly.
> 
> br
> Kim

I put some comments in the bug report (starting at comment 16). I don't 
really see how this would be happening unless there is an issue with the 
osapi_compute service version, like if you're running the API with uwsgi 
(which wasn't supported in ocata) or if you're API services are not all 
upgraded yet.

The workaround with the 1 second sleep seems to suggest there is a race 
window where the instance is not mapped to a cell yet but the build 
request is also gone, which shouldn't happen as we create the instance 
in the cell before deleting the build request:

https://github.com/openstack/nova/blob/15.0.0/nova/conductor/manager.py#L914

https://github.com/openstack/nova/blob/15.0.0/nova/conductor/manager.py#L937

So while it's possible for the instance to be created in the cell 
database but the instance mapping record isn't yet updated, we account 
for that when looking up the instance here:

https://github.com/openstack/nova/blob/15.0.0/nova/compute/api.py#L2276

and here:

https://github.com/openstack/nova/blob/15.0.0/nova/compute/api.py#L2289

-- 

Thanks,

Matt



More information about the OpenStack-dev mailing list