Cannot create a cluster with instances using a specific volume type because there is a mismatch between client and server code in referencing the type data in the request

Bug #1623005 reported by Janice-Chen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack DBaaS (Trove)
Fix Released
High
Janice-Chen

Bug Description

Trove cluster-create service can not get the 'volume_type' value even specifies the volume_type when create a cluster using 'trove cluster-create' command.

Test Cli View:

trove cluster-create ClusterName mongodb mongodb-3.2 \
--instance "flavor=flavorId,volume=10,volume_type=ssd,nic='net-id=NetID'" \
--instance "flavor=flavorId,volume=10,volume_type=ssd,nic='net-id=NetID'" \
--instance "flavor=flavorId,volume=10,volume_type=ssd,nic='net-id=NetID'"

The bug is a clear error in the code.I found that python-troveclient describe volume_type in its request body with the key 'type' while trove cluster_create cli parsing with the key "volume_type".cluster_create cli will never get the specified volume_type in current codes.

This bug also affects bug:https://bugs.launchpad.net/trove/+bug/1622957,but can not resolve it.

Tags: trove
Changed in trove:
assignee: nobody → Janice-Chen (784059080-c)
Revision history for this message
Amrith Kumar (amrith) wrote :
Changed in trove:
status: New → Incomplete
Changed in trove:
status: Incomplete → In Progress
Revision history for this message
Amrith Kumar (amrith) wrote :

Please don't mark the bug in progress if it is a duplicate of the other almost identical bug.

Changed in trove:
status: In Progress → Incomplete
Changed in trove:
status: Incomplete → In Progress
Revision history for this message
Janice-Chen (784059080-c) wrote :

The two bugs are not the same, I submit another one, but the two are related indeed.For bug1 -https://bugs.launchpad.net/trove/+bug/1622957,it's mongodb who neglect volume_type parameter, but this bug will causes all datastore failed to get volume_type when creating a cluster with a specified volume type

Revision history for this message
Amrith Kumar (amrith) wrote :

your bugs really need to have more information about the problem you are facing. Something which we can use to assess how serious of a problem this is and triage the bug accordingly.

So please DO NOT mark the bug as in progress till it is fully documented.

Changed in trove:
status: In Progress → Incomplete
description: updated
Revision history for this message
Amrith Kumar (amrith) wrote :

Janice Chen has submitted a patch for this issue https://review.openstack.org/#/c/369873/1. The change seems to point to a real problem.

The client passes in volume_type as the parameter 'type' in the request however the server code for clusters appears to be looking for 'volume_type'.

I'm updating the bug to make it more informative. Here is the proposed fix.

diff --git a/trove/cluster/service.py b/trove/cluster/service.py
index 0cb7afc..e315fc8 100644
--- a/trove/cluster/service.py
+++ b/trove/cluster/service.py
@@ -160,7 +160,7 @@ class ClusterController(wsgi.Controller):
             volume_size = volume_type = nics = availability_zone = None
             if 'volume' in node:
                 volume_size = int(node['volume']['size'])
- volume_type = node['volume'].get('volume_type')
+ volume_type = node['volume'].get('type')
             if 'nics' in node:
                 nics = node['nics']
             if 'availability_zone' in node:

summary: - Can not get 'volume_type' from troveclient request body when create
- cluster
+ Cannot create a cluster with instances using a specific volume type
+ because there is a mismatch between client and server code in
+ referencing the type data in the request
Changed in trove:
status: Incomplete → Confirmed
importance: Undecided → High
milestone: none → next
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to trove (master)

Reviewed: https://review.openstack.org/369873
Committed: https://git.openstack.org/cgit/openstack/trove/commit/?id=72330ac568e140a6d5fa3820a30ce61ec65a0b82
Submitter: Jenkins
Branch: master

commit 72330ac568e140a6d5fa3820a30ce61ec65a0b82
Author: chenshujuan <email address hidden>
Date: Wed Sep 14 15:38:29 2016 +0800

    Cluster code looks for wrong field in request for volume type

    The cluster code on the server side is looking for a field called
    'volume_type' in the request. The correct field should be 'type'.

    Closes-Bug: #1623005
    Change-Id: I5f46b887e028819dcd2d18da6390d38401528194
    Author: chenshujuan <email address hidden>
    Owner: chenshujuan <email address hidden>

Changed in trove:
status: Confirmed → Fix Released
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.