Managing a share with an invalid share type results in a share created

Bug #1561139 reported by Alex Meade
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Shared File Systems Service (Manila)
Fix Released
Medium
Rodrigo Barbieri

Bug Description

Although the API correctly returns an HTTP 409 error, a share is still created. Since the API knows ahead of time, the share should never be created.

1. Create a share type
manila type-create invalid true
+----------------------+--------------------------------------+
| Property | Value |
+----------------------+--------------------------------------+
| required_extra_specs | driver_handles_share_servers : True |
| Name | invalid |
| Visibility | public |
| is_default | - |
| ID | 5ca6a212-35b7-4382-b0bf-537f074f8c2b |
| optional_extra_specs | snapshot_support : True |
+----------------------+--------------------------------------+

2. Manage share
manila manage openstack2@cmodeSSVMNFS#aggr3 NFS 172.20.124.230:/share_2b1768a8_56c5_48e7_b6a5_4735e1b19b4b --share-type invalid
ERROR: Invalid host: Host openstack2@cmodeSSVMNFS#aggr3 did not pass validation for managing of share b943ecd1-5ad4-4e11-a9b1-626aa73234f6 with type 5ca6a212-35b7-4382-b0bf-537f074f8c2b.

3. Do a show on the uuid provided

manila show b943ecd1-5ad4-4e11-a9b1-626aa73234f6
+-----------------------------+-------------------------------------------------------------------+
| Property | Value |
+-----------------------------+-------------------------------------------------------------------+
| status | manage_error |
| share_type_name | invalid |
| description | None |
| availability_zone | None |
| share_network_id | None |
| export_locations | |
| | path = 172.20.124.230:/share_2b1768a8_56c5_48e7_b6a5_4735e1b19b4b |
| | preferred = False |
| | is_admin_only = False |
| | id = 8ca079bc-71d9-4038-8588-9317df296513 |
| | share_instance_id = 2198adff-58df-4f7d-b3bc-330afbe37398 |
| share_server_id | None |
| host | openstack2@cmodeSSVMNFS#aggr3 |
| access_rules_status | active |
| snapshot_id | None |
| is_public | False |
| task_state | None |
| snapshot_support | True |
| id | b943ecd1-5ad4-4e11-a9b1-626aa73234f6 |
| size | None |
| name | None |
| share_type | 5ca6a212-35b7-4382-b0bf-537f074f8c2b |
| has_replicas | False |
| replication_type | None |
| created_at | 2016-03-23T17:52:44.000000 |
| share_proto | NFS |
| consistency_group_id | None |
| source_cgsnapshot_member_id | None |
| project_id | 3d1d93550b1448f094389d6b5df9659e |
| metadata | {} |
+-----------------------------+-------------------------------------------------------------------+

Changed in manila:
importance: Undecided → Medium
tags: added: api
Revision history for this message
Andrew Kerr (andrew-kerr) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to manila (master)

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

Changed in manila:
assignee: nobody → Rodrigo Barbieri (rodrigo-barbieri2010)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila (master)

Reviewed: https://review.openstack.org/296706
Committed: https://git.openstack.org/cgit/openstack/manila/commit/?id=165b03e02102e7ab760ccb7f9bb24ff771d4b408
Submitter: Jenkins
Branch: master

commit 165b03e02102e7ab760ccb7f9bb24ff771d4b408
Author: Rodrigo Barbieri <email address hidden>
Date: Wed Mar 23 15:43:03 2016 -0300

    Fix Manage API synchronous call

    RPCAPI call to Scheduler to perform share_type and host
    validation should be asynchronous so share can be
    created in DB with status "manage_error" if validation
    is not successful.

    This change also addresses incorrect exception type in API
    and DB popping fields from supplied parameter.

    APIImpact

    Closes-bug: #1561139
    Change-Id: I928f1d6b5657098f9d2b7917e2e334a1f08903f8

Changed in manila:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to manila (stable/mitaka)

Fix proposed to branch: stable/mitaka
Review: https://review.openstack.org/306413

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila (stable/mitaka)

Reviewed: https://review.openstack.org/306413
Committed: https://git.openstack.org/cgit/openstack/manila/commit/?id=3eaf9bf23b1aaaadba4ea36b3f26cf1f8ec7b19f
Submitter: Jenkins
Branch: stable/mitaka

commit 3eaf9bf23b1aaaadba4ea36b3f26cf1f8ec7b19f
Author: Rodrigo Barbieri <email address hidden>
Date: Wed Mar 23 15:43:03 2016 -0300

    Fix Manage API synchronous call

    Backporting this to stable/mitaka to fix improper behavior
    of manage API.

    Original description below:

    RPCAPI call to Scheduler to perform share_type and host
    validation should be asynchronous so share can be
    created in DB with status "manage_error" if validation
    is not successful.

    This change also addresses incorrect exception type in API
    and DB popping fields from supplied parameter.

    APIImpact

    (cherry-picked from commit 165b03e02102e7ab760ccb7f9bb24ff771d4b408)
    Closes-bug: #1561139
    Change-Id: If9960d22a63c3db30179c7a4ce5b805cef983b73

tags: added: in-stable-mitaka
Revision history for this message
Thierry Carrez (ttx) wrote : Fix included in openstack/manila 3.0.0.0b1

This issue was fixed in the openstack/manila 3.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.