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

2016-01-08 Thread John Garbutt
On 4 January 2016 at 12:55, Sean Dague  wrote:
> 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.

+1
Thats a great summary of the approach we need here.

We should try get some XenServer using folks to help out with this one.
Bob, lets bring this up at the next Xen meeting?

> 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.

I have prototype unit tests for the plugins, but I have not had time
to finish it.
There are some ideas in here on how it could work:
https://review.openstack.org/#/c/128886

Thanks,
johnthetubaguy

__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


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

2016-01-04 Thread Sean Dague
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

__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


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

2015-12-30 Thread Bob Ball
Hi Mikhail,

Unfortunately I completely agree that using Glance with the XenServer plugin is 
painful.  As Keven pointed out, the current release of XenServer includes 
python 2.4 in dom0 (where the plugin runs) so having a dependency on nova.image 
or glanceclient is likely to introduce more pain than it might solve.

I would prefer approach 2; if we can reduce the amount of logic in the glance 
plugin and move it into the XenAPI driver in Nova then I think that would be a 
very good thing.

We would, of course, be interested in helping fix the plugin to support glance 
v2, so we should sync up on IRC in the new year (bobball)

Bob


From: Mikhail Fedosin [mfedo...@mirantis.com]
Sent: 24 December 2015 13:51
To: OpenStack Development Mailing List (not for usage questions)
Subject: [openstack-dev] [Nova][Glance] Xenplugin + Glance_v2 = Hate

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!

--
Best regards,
Mikhail Fedosin
__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


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

2015-12-29 Thread Kevin L. Mitchell
On Thu, 2015-12-24 at 16:51 +0300, 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!

Unfortunately, the big problem is that, last I knew, Xenserver comes
with Python 2.4 installed.  This forces all sorts of constraints on the
plugin code, including the inability to use interfaces like
glanceclient, due to the unsupported Python version; this is why the
plugin uses its own HTTP client implementation.  If we're going to
update the plugins to use more recent versions of Python, we're going to
have to warn the operator community about the consequences well in
advance, so that all the issues can be worked out…
-- 
Kevin L. Mitchell 
Rackspace


__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


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

2015-12-24 Thread Mikhail Fedosin
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!

--
Best regards,
Mikhail Fedosin
__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev