Queens charms still use legacy Nova API version

Bug #1795826 reported by Radu Popescu
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Nova Cloud Controller Charm
New
Undecided
Unassigned

Bug Description

We're deploying OpenStack Queens on Ubuntu Bionic using charms. The issue is that the generated endpoints still use the legacy Nova 2.0 version. This means that micro-versions are not available, along with the API features introduced in the last few years.

Looking at the code, we found out that there seems to be a check which enables the 2.1 Nova API version starting with Queens but most probably the OpenStack version isn't properly detected.

### ./hooks/nova_cc_utils.py
def determine_endpoints(public_url, internal_url, admin_url):
    '''Generates a dictionary containing all relevant endpoints to be
    passed to keystone as relation settings.'''
    region = config('region')
    os_rel = os_release('nova-common')
    cmp_os_rel = CompareOpenStackReleases(os_rel)

    nova_public_url = ('%s:%s/v2/$(tenant_id)s' %
                       (public_url, api_port('nova-api-os-compute')))
    nova_internal_url = ('%s:%s/v2/$(tenant_id)s' %
                         (internal_url, api_port('nova-api-os-compute')))
    nova_admin_url = ('%s:%s/v2/$(tenant_id)s' %
                      (admin_url, api_port('nova-api-os-compute')))
    if cmp_os_rel >= 'queens':
        nova_public_url = (
            '%s:%s/v2.1' %
            (public_url, api_port('nova-api-os-compute'))
        )
        nova_internal_url = (
            '%s:%s/v2.1' %
            (internal_url, api_port('nova-api-os-compute'))
        )
        nova_admin_url = (
            '%s:%s/v2.1' %
            (admin_url, api_port('nova-api-os-compute'))
        )

Those depend on os_rel, which asks os_release for the version...

### ./hooks/charmhelpers/contrib/openstack/utils.py
def os_release(package, base='essex', reset_cache=False):
    '''
    Returns OpenStack release codename from a cached global.

    If reset_cache then unset the cached os_release version and return the
    freshly determined version.

    If the codename can not be determined from either an installed package or
    the installation source, the earliest release supported by the charm should
    be returned.
    '''
    global _os_rel
    if reset_cache:
        reset_os_release()
    if _os_rel:
        return _os_rel
    _os_rel = (
        get_os_codename_package(package, fatal=False) or
        get_os_codename_install_source(config('openstack-origin')) or
        base)
    return _os_rel

Should be enough to get the version of the nova-common package and see it has queens installed. The version installed is:

ii nova-common 2:17.0.5-0ubuntu1 all OpenStack Compute - common files

And it should match queens, because:

### ./hooks/charmhelpers/contrib/openstack/utils.py
# >= Liberty version->codename mapping
PACKAGE_CODENAMES = {
    'nova-common': OrderedDict([
        ('12', 'liberty'),
        ('13', 'mitaka'),
        ('14', 'newton'),
        ('15', 'ocata'),
        ('16', 'pike'),
        ('17', 'queens'),
        ('18', 'rocky'),
    ]),

But it doesn't. OpenStack origin, since we're using Bionic, is set to "distro".

Thanks!

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.