[openstack-dev] [Nova][Glance] Xenplugin + Glance_v2 = Hate

Sean Dague sean at dague.net
Mon Jan 4 12:55:48 UTC 2016


On 12/24/2015 08:51 AM, Mikhail Fedosin wrote:
> Hello! As you may know there is a big initiative to adopt glance v2 api
> in Nova and the important part is making related changes in xenglugin.
> Unfortunately xenplugin doesn't use neither nova.image api nor
> glanceclient. Instead of this it has own http client implementation and
> bunch of hardcoded 'v1' urls (example,
> https://github.com/openstack/nova/blob/master/plugins/xenserver/xenapi/etc/xapi.d/plugins/glance#L130).
> It leads to the fact, that it will be really hard to switch it on v2 api
> right.
> 
> Personally I see 2 solutions:
> 1. Make xenplugin to adopt nova.image api, which will make it
> version-agnostic. Here it's not easy to implement and we won't be able
> to keep backward compatibility with the existing lowlevel code.
> 2. Also hardcode v2 urls on par with v1 and do the same thing as in
> nova.image - to determine current glance api version before request and
> then use appropriate urls in methods.
> 
> IMHO, the second solution is more preferable, because I understand how
> to do it and the v1/v2 compatibility will be 100%. It guarantees that we
> won't break any of existing deployments and it will allow to merge
> glance_v2 code in nova.image much quicker.
> 
> All opinions and advice will be very helpful. Thanks in advance!

So it is a little weird, but it's not as terrible as it could be.

The glance plugin is effectively an RPC interface from Nova proper. I
just had to bump it to make glance pass around urls instead of tuples -
https://review.openstack.org/#/c/254785/6/plugins/xenserver/xenapi/etc/xapi.d/plugins/glance

I would just add another set of calls in that glance plugin that use v2
instead of v1. Then let nova decide it's going to call v2 vs. v1 from
it's side.

As a bonus, having *some* testing added to this path would be great as
well. The xenserver glance plugins have no tests right now, and doing
something like v2 vs. v1 would be good to get something basic tested there.

	-Sean

-- 
Sean Dague
http://dague.net



More information about the OpenStack-dev mailing list