Cinder API v2 - os-attach fails without mountpoint specified

Bug #1575675 reported by Eric Smith
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Low
Matt Riedemann

Bug Description

URL = http://os-host:8776/v2/tenant-id/volumes/volume-id/action
{"os-attach" : {"instance_uuid" : "instance-id"}}
HTTP Status code = 500
Response text = {"computeFault": {"message": "The server has either erred or is incapable of performing the requested operation.", "code": 500}}

This works when specifying a mount point. Here are the logs from cinder-api.log:

./api.log:2016-04-27 09:06:57.765 4955 INFO cinder.api.openstack.wsgi [req-894e2162-cc96-4b41-a674-5b4aad0d5823 b36b3bc78c7848cb89b3919cabbf3752 tenant-id - - -] POST http://os-host:8776/v2/tenant-id/volumes/volume-id/action
./api.log:2016-04-27 09:06:57.803 4955 ERROR cinder.api.middleware.fault [req-894e2162-cc96-4b41-a674-5b4aad0d5823 b36b3bc78c7848cb89b3919cabbf3752 tenant-id - - -] Caught error: 'mountpoint'
./api.log:2016-04-27 09:06:57.803 4955 INFO cinder.api.middleware.fault [req-894e2162-cc96-4b41-a674-5b4aad0d5823 b36b3bc78c7848cb89b3919cabbf3752 tenant-id - - -] http://os-host:8776/v2/tenant-id/volumes/volume-id/action returned with HTTP 500
./api.log:2016-04-27 09:06:57.804 4955 INFO eventlet.wsgi.server [req-894e2162-cc96-4b41-a674-5b4aad0d5823 b36b3bc78c7848cb89b3919cabbf3752 tenant-id - - -] os-host - - [27/Apr/2016 09:06:57] "POST /v2/tenant-id/volumes/volume-id/action HTTP/1.1" 500 425 0.

Changed in cinder:
importance: Undecided → Low
assignee: nobody → Mitsuhiro Tanino (mitsuhiro-tanino)
Revision history for this message
Mitsuhiro Tanino (mitsuhiro-tanino) wrote :

In the API reference guide(http://developer.openstack.org/api-ref-blockstorage-v2.html), the mountpoint is a optional parameter, but contrib/volume_actions.py expects mountpoint is included in the request body.

Seems mountpoint is used as only debug logging purpose at attach_volume in manager.py, so we may make the "mountpoint" as an optional.

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/313180

Changed in cinder:
status: New → In Progress
Revision history for this message
Mitsuhiro Tanino (mitsuhiro-tanino) wrote :

New attach/detach API call is proposed and under discussion now.
I'll keep open this bug until the discussion will be concluded.

Add new attach/detach API calls
https://review.openstack.org/#/c/327408/

Changed in cinder:
status: In Progress → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on cinder (master)

Change abandoned by Mitsuhiro Tanino (<email address hidden>) on branch: master
Review: https://review.openstack.org/313180

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/449223

Changed in cinder:
assignee: Mitsuhiro Tanino (mitsuhiro-tanino) → Matt Riedemann (mriedem)
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/449223
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=6b04a764cb3abd6820d505c2aab7630b7b4205e5
Submitter: Jenkins
Branch: master

commit 6b04a764cb3abd6820d505c2aab7630b7b4205e5
Author: Matt Riedemann <email address hidden>
Date: Thu Mar 23 12:49:30 2017 -0400

    Fix 500 error when 'mountpoint' is not provided to os-attach

    This fixes the 500 resulting from the KeyError when mountpoint
    is not provided during an os-attach call. It also fixes the
    API reference docs to no longer lie about mountpoint being
    an optional parameter.

    Change-Id: Ica9ccb0246bc84c087afc338b5102ce48f57e82b
    Closes-Bug: #1575675

Changed in cinder:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/cinder 11.0.0.0b1

This issue was fixed in the openstack/cinder 11.0.0.0b1 development milestone.

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.