Impossible to invoke novaclient APIs

Bug #1401800 reported by Trung Trinh
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
High
Trung Trinh

Bug Description

Version: stable/juno

Bug description:
Even though the module cinder.compute.nova is provided, it's actually useless because it's impossible to invoke novaclient APIs.
This is because the connection to the compute endpoint can't be established.
The consequence is that all the functions, which are implemented in class API of the module cinder.compute.nova, are useless.

Proposal:
Define a valid compute endpoint.

Changed in cinder:
assignee: nobody → Trung Trinh (trung-t-trinh)
status: New → In Progress
Revision history for this message
Trung Trinh (trung-t-trinh) wrote :

Root cause is found out as follows.

In function "url_for()" of the class "ServiceCatalog" inside the module "novaclient.service_catalog", the exceptions.EndpointNotFound is raised because no matching endpoint found.

This is because in the module "cinder.compute.nova", the configuration for the info of "<service_name>" is wrongly hard-coded with the value of "nova". Instead, it must have been the value of "Compute Service" which is found in the variable "context.service_catalog"

This can be seen by adding more debug log as follows:

2014-12-13 00:21:57,900 - my_logger - DEBUG - cinder.compute.nova - novaclient() - service_type:compute, service_name:Compute Service, endpoint_type:publicURL, service_catalog:[{u'endpoints': [{u'adminURL': u'http://192.168.56.103:8774/v2/e97e53f28fd64a02a90ae39c5e7c2049', u'region': u'RegionOne', u'internalURL': u'http://192.168.56.103:8774/v2/e97e53f28fd64a02a90ae39c5e7c2049', u'publicURL': u'http://192.168.56.103:8774/v2/e97e53f28fd64a02a90ae39c5e7c2049'}], u'type': u'compute', u'name': u'Compute Service'}, {u'endpoints': [{u'adminURL': u'http://192.168.56.103:8080/', u'region': u'RegionOne', u'internalURL': u'http://192.168.56.103:8080/v1/AUTH_e97e53f28fd64a02a90ae39c5e7c2049', u'publicURL': u'http://192.168.56.103:8080/v1/AUTH_e97e53f28fd64a02a90ae39c5e7c2049'}], u'type': u'object-store', u'name': u'Swift Service'}]

2014-12-13 00:21:57,903 - my_logger - DEBUG - cinder.compute.nova - novaclient() - Novaclient connection created using URL:http://192.168.56.103:8774/v2/e97e53f28fd64a02a90ae39c5e7c2049, context.service_catalog:[{u'endpoints': [{u'adminURL': u'http://192.168.56.103:8774/v2/e97e53f28fd64a02a90ae39c5e7c2049', u'region': u'RegionOne', 'serviceName': u'Compute Service', u'internalURL': u'http://192.168.56.103:8774/v2/e97e53f28fd64a02a90ae39c5e7c2049', u'publicURL': u'http://192.168.56.103:8774/v2/e97e53f28fd64a02a90ae39c5e7c2049'}], u'type': u'compute', u'name': u'Compute Service'}, {u'endpoints': [{u'adminURL': u'http://192.168.56.103:8080/', u'region': u'RegionOne', u'internalURL': u'http://192.168.56.103:8080/v1/AUTH_e97e53f28fd64a02a90ae39c5e7c2049', u'publicURL': u'http://192.168.56.103:8080/v1/AUTH_e97e53f28fd64a02a90ae39c5e7c2049'}], u'type': u'object-store', u'name': u'Swift Service'}]

Bug fix proposal:

In the module "cinder.compute.nova", change the "nova_opts" to this one:

nova_opts = [
    cfg.StrOpt('nova_catalog_info',
               default='compute:Compute Service:publicURL',
               help='Match this value when searching for nova in the '
                    'service catalog. Format is: separated values of '
                    'the form: '
                    '<service_type>:<service_name>:<endpoint_type>'),
    cfg.StrOpt('nova_catalog_admin_info',
               default='compute:Compute Service:adminURL',
               help='Same as nova_catalog_info, but for admin endpoint.'),
   ..................

Revision history for this message
Trung Trinh (trung-t-trinh) wrote :

The "<service_name>" is defined in Keystone's config file "/etc/keystone/default_catalog.templates" as follows:

                     catalog.RegionOne.compute.name = Compute Service

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

Fix proposed to branch: master
Review: https://review.openstack.org/141727

Changed in cinder:
assignee: Trung Trinh (trung-t-trinh) → Huang Zhiteng (zhiteng-huang)
Revision history for this message
Trung Trinh (trung-t-trinh) wrote :

Hi,

Why did you kick me out from this bug?

Changed in cinder:
assignee: Huang Zhiteng (zhiteng-huang) → Trung Trinh (trung-t-trinh)
Revision history for this message
Huang Zhiteng (zhiteng-huang) wrote :

Easy, Trung. I updated the commit message for your patch (you can consider it as someone <me> doing a rebase to master branch with commit message update on behave of you), because the fix itself looks OK, I don't want to -1 your fix and bother you to submit another version. As a result of the commit message update, the committer of the change becomes me, but you are still the author, unfortunately, the bug tracking system (lauchpad) isn't smart enough to use 'Author' as the assignee of bug, but always use 'Committer'. As you can see, you can always change assignee back to correct person.

I need to be very clear that I have no intention to 'steal' your credit *at all* and what I was doing doesn't really hurt your credit (you are the author, your contribution to OpenStack project gets one more commit when it lands). But still I am sorry for causing this confusion.

Jay Bryant (jsbryant)
Changed in cinder:
importance: Undecided → High
Revision history for this message
Walt Boring (walter-boring) wrote :

Hello Trung,
    First of all I want to say thank you for your code submission and working on the Cinder project along with us.

What looks like an intentional action to take credit for something that you have clearly spent time on, is more of
a technical issue with some of our tool chains and how the OpenStack Infra tools work.

Winston did in fact make a submission to your patchset, which simply made some changes to your
commit message. His intentions were to make the information about your patch much clearer
for history's sake. Now, due to the fact that he submitted a patchset against your patch, the tool chain
takes over and does some things automatically. When a patchset is submitted against a bug, the
commit hooks takeover in gerrit that does the updates that you saw with respect to the blueprint and the bug.

Winston did not do this intentionally with malice to take credit for your work. This is simply an artifact
of how the tools and commit hooks work within the OpenStack infrastructure.

We really do appreciate your hard work.

I hope this helps to clear things up a bit.

Revision history for this message
Trung Trinh (trung-t-trinh) wrote :

Hi all,

Thanks for explaining the things. I understand that this is just due to the OpenStack Infra.

description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/141727
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=5ad15c040fdc115bca9efb1c952279988a2a48b3
Submitter: Jenkins
Branch: master

commit 5ad15c040fdc115bca9efb1c952279988a2a48b3
Author: Trung Trinh <email address hidden>
Date: Mon Dec 15 20:23:34 2014 +1400

    Correct default service_name for nova_catalog*_info config option

    The default service_name in config option (nova_catalog_info and
    nova_catalog_admin_info) was mistakenly put as 'nova'. Consequently,
    it is impossible to invoke novaclient APIs from Cinder code without
    changing the default value of those config options.

    The correct service_name defined in Keystone's config file
    "/etc/keystone/default_catalog.templates" is:
    catalog.RegionOne.compute.name = Compute Service.

    This change replaces 'nova' with 'Compute Service' for default value
    of 'nova_catalog*_info' config options.

    Change-Id: Idee3585a08efa1d6af1f4ee2b74e8cefb05cc54f
    Closes-Bug: 1401800

Changed in cinder:
status: In Progress → Fix Committed
Mike Perez (thingee)
Changed in cinder:
milestone: none → kilo-1
Thierry Carrez (ttx)
Changed in cinder:
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (stable/juno)

Fix proposed to branch: stable/juno
Review: https://review.openstack.org/149552

Mike Perez (thingee)
tags: removed: cinder
Thierry Carrez (ttx)
Changed in cinder:
milestone: kilo-1 → 2015.1.0
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on cinder (stable/juno)

Change abandoned by Mike Perez (<email address hidden>) on branch: stable/juno
Review: https://review.openstack.org/149552
Reason: Over a month with no update.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.