volume_type not supported in version 2.72

Bug #1829854 reported by Eric Xie
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
python-novaclient
Fix Released
High
Eric Xie
Stein
Fix Released
High
Brin Zhang

Bug Description

Description
===========
From https://developer.openstack.org/api-ref/compute/?expanded=create-server-detail#create-server, i see
'volume_type' supported in version 2.67.
From CLI 'nova help boot'
                                volume_type=type of volume to
                                create (either ID or name) when source is
                                blank, image or snapshot and dest is volume
                                (optional). (Supported by API versions '2.67'
                                - '2.latest')

But when i used the 2.latest to test, got unsupported in 2.72
# nova --os-compute-api-version 2.latest boot --flavor m1.tiny --image cirros-0.4.0-x86_64-disk --nic net-id=ec4a4958-7666-4bc0-9329-ce4d571d39a5 --block-device source=blank,dest=volume,volume_type=lvmdriver-1,size=1 test-t
ERROR (CommandError): 'volume_type' in block device mapping is not supported in API version 2.72.

Steps to reproduce
==================
* Setup devstack env
* nova --os-compute-api-version 2.latest boot --flavor m1.tiny --image cirros-0.4.0-x86_64-disk --nic net-id=ec4a4958-7666-4bc0-9329-ce4d571d39a5 --block-device source=blank,dest=volume,volume_type=lvmdriver-1,size=1 test-t

Expected result
===============
Create instance successfully

Actual result
=============
ERROR (CommandError): 'volume_type' in block device mapping is not supported in API version 2.72.

Environment
===========
# git log
commit fc3890667e4971e3f0f35ac921c2a6c25f72adec
Author: OpenDev Sysadmins <email address hidden>
Date: Fri Apr 19 19:45:52 2019 +0000

    OpenDev Migration Patch

    This commit was bulk generated and pushed by the OpenDev sysadmins
    as a part of the Git hosting and code review systems migration
    detailed in these mailing list posts:

    http://lists.openstack.org/pipermail/openstack-discuss/2019-March/003603.html
    http://lists.openstack.org/pipermail/openstack-discuss/2019-April/004920.html

    Attempts have been made to correct repository namespaces and
    hostnames based on simple pattern matching, but it's possible some
    were updated incorrectly or missed entirely. Please reach out to us
    via the contact information listed at https://opendev.org/ with any
    questions you may have.

Revision history for this message
Eric Xie (eric-xie) wrote :

I tried 2.68 above, and found only support in 2.67.
So i think the description of `nova help boot` should be modified.

Changed in nova:
assignee: nobody → Eric Xie (eric-xie)
affects: nova → python-novaclient
Changed in python-novaclient:
status: New → Confirmed
Revision history for this message
melanie witt (melwitt) wrote :

I think the bug is here, in the version check for volume_type [1]:

  supports_volume_type = cs.api_version == api_versions.APIVersion('2.67')

The comparison here is supposed to be '>=', not '=='.

We need to fix that ^ instead of updating the help message.

We'll also need to backport the fix to stein, where the bug was introduced.

[1] https://github.com/openstack/python-novaclient/blob/dfb84228a2748bed82f9b83c1209d5e2e0557bfa/novaclient/v2/shell.py#L148

Changed in python-novaclient:
importance: Undecided → High
Revision history for this message
Matt Riedemann (mriedem) wrote :

Yup, my mistake, should be an easy fix though.

Revision history for this message
Eric Xie (eric-xie) wrote :

@melanie, thanks for your reply. I will try to fix it.

affects: python-novaclient → nova
Eric Xie (eric-xie)
affects: nova → python-novaclient
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-novaclient (master)

Reviewed: https://review.opendev.org/660861
Committed: https://git.openstack.org/cgit/openstack/python-novaclient/commit/?id=7b9d3000893aefa9c5efc77b50dc0fec5cab29be
Submitter: Zuul
Branch: master

commit 7b9d3000893aefa9c5efc77b50dc0fec5cab29be
Author: zhangbailin <email address hidden>
Date: Thu May 23 08:18:00 2019 +0800

    Set the lower limit of api_version for volume_type

    In boot server API, the volume_type is supported by microversion 2.67.
    Therefore, the lower limit of the volume_type should be added to the CLI
    command, otherwise an exception will occur.

    Co-Authored-By: Eric Xie <eric_xiett@163.com>

    Closes-Bug: #1829854
    Change-Id: Ie909c16568b017ca0acc802194140da7bece76c5

Changed in python-novaclient:
status: Confirmed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-novaclient (stable/stein)

Fix proposed to branch: stable/stein
Review: https://review.opendev.org/661024

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-novaclient (stable/stein)

Reviewed: https://review.opendev.org/661024
Committed: https://git.openstack.org/cgit/openstack/python-novaclient/commit/?id=ef842ca0d834a52b1dfb1ae5155cbd4993a599a1
Submitter: Zuul
Branch: stable/stein

commit ef842ca0d834a52b1dfb1ae5155cbd4993a599a1
Author: zhangbailin <email address hidden>
Date: Thu May 23 08:18:00 2019 +0800

    Set the lower limit of api_version for volume_type

    In boot server API, the volume_type is supported by microversion 2.67.
    Therefore, the lower limit of the volume_type should be added to the CLI
    command, otherwise an exception will occur.

    Co-Authored-By: Eric Xie <eric_xiett@163.com>

    Closes-Bug: #1829854
    Change-Id: Ie909c16568b017ca0acc802194140da7bece76c5
    (cherry picked from commit 7b9d3000893aefa9c5efc77b50dc0fec5cab29be)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-novaclient 14.1.0

This issue was fixed in the openstack/python-novaclient 14.1.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-novaclient 13.0.1

This issue was fixed in the openstack/python-novaclient 13.0.1 release.

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.