osc 1.7 no longer can boot a server from volume

Bug #1501435 reported by Sean Dague
20
This bug affects 2 people
Affects Status Importance Assigned to Milestone
python-novaclient
Fix Released
Critical
melanie witt

Bug Description

Trying to use osc in grenade to boot a server from volume. This is done via the following commands:

openstack volume create --image $DEFAULT_IMAGE_NAME --size 1 $CINDER_VOL -f shell

    openstack server create --volume $id \
        --flavor $DEFAULT_INSTANCE_TYPE \
        --security-group $CINDER_USER \
        --key-name $CINDER_KEY \
        $net \
        $CINDER_SERVER --wait

When this is done in stable/kilo (osc 1.0.4) the following request is sent to Nova:

Action: 'create', calling method: <bound method Controller.create of <nova.api.openstack.compute.servers.Controller object at 0x7f2bfdc723d0>>, body: {"server": {"name": "cinder_server1", "imageRef": "", "block_device_mapping": [{"source_type": "volume", "boot_index": 0, "uuid": "b9b271c3-ef26-405c-89ec-18e457ab8851", "volume_id": "b9b271c3-ef26-405c-89ec-18e457ab8851", "device_name": "vda"}], "key_name": "cinder_key", "flavorRef": "1", "max_count": 1, "min_count": 1, "security_groups": [{"name": "cinder_grenade"}]}}

When this is done in stable/liberty with osc 1.7.0 the following request is sent to Nova:

Action: 'create', calling method: <bound method ServersController.create of <nova.api.openstack.compute.servers.ServersController object at 0x7f722545fcd0>>, body: {"server": {"name": "cinder_server1", "imageRef": "", "block_device_mapping": [{"device_name": "vda"}], "key_name": "cinder_key", "flavorRef": "1", "max_count": 1, "min_count": 1, "security_groups": [{"name": "cinder_grenade"}]}}

This is notably missing all the actual information about the volume. Which means boot from volume is no longer a thing users can do with osc 1.7.

Sean Dague (sdague)
Changed in python-openstackclient:
importance: Undecided → Critical
Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote :
Revision history for this message
Sean Dague (sdague) wrote :

Yes, that seems like the same issue

Changed in python-novaclient:
importance: Undecided → Critical
Revision history for this message
Sean Dague (sdague) wrote :

This is actually a python-novaclient bug, it was introduced in this change - https://review.openstack.org/#/c/221525/

That removed block_device_mapping={"vda": "$volume_id"} support by eliminating the ==1 branch on _parse_block_device_mapping.

It was assumed safe because it was a private method, but that private method is doing data transformation on a value without any interpolation otherwise. So it's really part of the public contract.

Revision history for this message
Sean Dague (sdague) wrote :

Revert to novaclient proposed here - https://review.openstack.org/#/c/229581/

Revision history for this message
melanie witt (melwitt) wrote :

In https://review.openstack.org/#/c/221525/ the intention was to remove bdm v2-only fields from the request to make novaclient bdm v1 boot work with nova API v2.1 schema validation. As Sean mentioned, the bug is that the volume_id field (a v1 and v2 field) was erroneously removed when "mapping_parts == 1"

Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote :

Sean, Melanie,

relaxing the server side code a little bit seems to deploy just fine - http://paste.openstack.org/show/474953/

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

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

Changed in python-novaclient:
assignee: nobody → melanie witt (melwitt)
status: New → In Progress
Changed in python-novaclient:
assignee: melanie witt (melwitt) → John Garbutt (johngarbutt)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-novaclient (stable/liberty)

Fix proposed to branch: stable/liberty
Review: https://review.openstack.org/229826

Revision history for this message
Matt Riedemann (mriedem) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-novaclient (master)

Reviewed: https://review.openstack.org/229669
Committed: https://git.openstack.org/cgit/openstack/python-novaclient/commit/?id=abd0630badaff18ca998db2feccb058e8ee75f23
Submitter: Jenkins
Branch: master

commit abd0630badaff18ca998db2feccb058e8ee75f23
Author: melanie witt <email address hidden>
Date: Wed Sep 30 22:55:03 2015 +0000

    Always send volume_id when booting with legacy bdm

    Commit 5153dcda807c554769081626c10c43d16adea671 removed bdm v2-only
    request parameters to pass nova api v2.1 schema validation, but also
    removed the ability to boot with legacy bdm specifying volume_id only.

    This adds volume_id back to the request for legacy bdm when
    no other parameters are specified.

    Closes-Bug: #1501435

    Change-Id: Ie8c56c28492793990ef7ed6dc54768cef9e28a98

Changed in python-novaclient:
status: In Progress → Fix Committed
tags: added: in-stable-liberty
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-novaclient (stable/liberty)

Reviewed: https://review.openstack.org/229826
Committed: https://git.openstack.org/cgit/openstack/python-novaclient/commit/?id=3424bc6d6238dcfac9d4ff05df6258e52b75b479
Submitter: Jenkins
Branch: stable/liberty

commit 3424bc6d6238dcfac9d4ff05df6258e52b75b479
Author: melanie witt <email address hidden>
Date: Wed Sep 30 22:55:03 2015 +0000

    Always send volume_id when booting with legacy bdm

    Commit 5153dcda807c554769081626c10c43d16adea671 removed bdm v2-only
    request parameters to pass nova api v2.1 schema validation, but also
    removed the ability to boot with legacy bdm specifying volume_id only.

    This adds volume_id back to the request for legacy bdm when
    no other parameters are specified.

    Closes-Bug: #1501435

    Conflicts:
     novaclient/tests/functional/test_servers.py

    Change-Id: Ie8c56c28492793990ef7ed6dc54768cef9e28a98
    (cherry picked from commit abd0630badaff18ca998db2feccb058e8ee75f23)

Revision history for this message
John Griffith (john-griffith) wrote :

I think we can remove OSC, based on what I was looking at the bug was in novaclient, and it looks like Mels patch fixes this up.

Dean Troyer (dtroyer)
no longer affects: python-openstackclient
Revision history for this message
Matt Riedemann (mriedem) wrote :

This will be in the 2.30.1 release for liberty and the 2.31.0 release for mitaka.

Changed in python-novaclient:
assignee: John Garbutt (johngarbutt) → melanie witt (melwitt)
Changed in python-novaclient:
milestone: none → 2.31.0
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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