[openstack-dev] [nova] Usability question for the server migrations API

Matt Riedemann mriedemos at gmail.com
Mon Apr 17 14:08:07 UTC 2017


On 4/17/2017 12:27 AM, Alex Xu wrote:
> Also note that, we still have the API '/os-migrations', it will return
> all the migration records in any status for all the VMs, and it supports
> filters like 'instance_uuid', 'status', and 'migration_type' etc. I
> can't remember clearly whether we said we will deprecated it, at least
> for now, we didn't deprecate it yet. Want to figure whether it still
> have some useful use-case for query multiple VMs' migration records.

Yeah that's a weird one. It's marked as "frozen" in the docs. The 
response is also different with microversion >= 2.23 such that after 
that point, the migration_type isn't in the response and is replaced 
with links to the server migration API if it's an in-progress live 
migration.

So I think this explains the response permutations based on microversion 
and type for /os-migrations:

1. microversion < 2.23:

Include all types of migrations in the response (assuming no filtering). 
Don't include the migration_type field in the response though.

2. microversion >= 2.23:

Include all types of migrations in the response.

a) If the migration is an in-progress live migration, then also return 
the migration_type in the response and provide links to the server 
migration: /servers/{server_id}/migrations/{migration_id}

b) If the migration is not for live migration or is not in progress, do 
not provide links but include migration_type in the response.

Needless to say, it gets a bit confusing. I have to read the code every 
time I think about this API (which is a sure sign it's bad). We also 
don't document the different responses based on type and microversion [1].

[1] https://bugs.launchpad.net/nova/+bug/1668747

-- 

Thanks,

Matt



More information about the OpenStack-dev mailing list