trove create instance 'volume' is a required property

Bug #1267104 reported by Ionuț Arțăriși on 2014-01-08
34
This bug affects 5 people
Affects Status Importance Assigned to Milestone
python-troveclient
Low
mariam john

Bug Description

I get this error when trying to create an instance with:
$ trove create fu 1

DEBUG (shell:660) Validation error: instance 'volume' is a required property (HTTP 400)
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/troveclient/shell.py", line 655, in main
    sys.argv[1:]))
  File "/usr/lib/python2.7/site-packages/troveclient/shell.py", line 494, in main
    args.func(self.cs, args)
  File "/usr/lib/python2.7/site-packages/troveclient/v1/shell.py", line 186, in do_create
    datastore_version=args.datastore_version)
  File "/usr/lib/python2.7/site-packages/troveclient/v1/instances.py", line 86, in create
    return self._create("/instances", body, "instance")
  File "/usr/lib/python2.7/site-packages/troveclient/base.py", line 155, in _create
    resp, body = self.api.client.post(url, body=body)
  File "/usr/lib/python2.7/site-packages/troveclient/client.py", line 211, in post
    return self._cs_request(url, 'POST', **kwargs)
  File "/usr/lib/python2.7/site-packages/troveclient/client.py", line 175, in _cs_request
    **kwargs)
  File "/usr/lib/python2.7/site-packages/troveclient/client.py", line 158, in request
    raise exceptions.from_response(resp, body, url)
BadRequest: Validation error: instance 'volume' is a required property (HTTP 400)
ERROR: Validation error: instance 'volume' is a required property

The trove-api service has this to say:

{"instance": {"flavorRef": "1", "name": "fu"}} authorize /usr/lib/python2.7/site-packages/trove/common/auth.py:66
2014-01-08 14:15:01.554 5717 DEBUG routes.middleware [-] No route matched for POST /0eae85e31bff4bc7bc3c20e695ebd4f3/instances __call__ /usr/lib/python2.7/site-packages/routes/middleware.py:97
2014-01-08 14:15:01.555 5717 DEBUG routes.middleware [-] Matched POST /0eae85e31bff4bc7bc3c20e695ebd4f3/instances __call__ /usr/lib/python2.7/site-packages/routes/middleware.py:100
2014-01-08 14:15:01.555 5717 DEBUG routes.middleware [-] Route path: '/{tenant_id}/instances', defaults: {'action': u'create', 'controller': <trove.common.wsgi.Resource object at 0x2e0d790>} __call__ /usr/lib/python2.7/site-packages/routes/middleware.py:102
2014-01-08 14:15:01.555 5717 DEBUG routes.middleware [-] Match dict: {'action': u'create', 'tenant_id': u'0eae85e31bff4bc7bc3c20e695ebd4f3', 'controller': <trove.common.wsgi.Resource object at 0x2e0d790>} __call__ /usr/lib/python2.7/site-packages/routes/middleware.py:103
2014-01-08 14:15:01.556 5717 DEBUG trove.common.wsgi [-] Getting schema for type:create get_schema /usr/lib/python2.7/site-packages/trove/common/wsgi.py:434
2014-01-08 14:15:01.556 5717 DEBUG trove.common.wsgi [-] Found Schema: none get_schema /usr/lib/python2.7/site-packages/trove/common/wsgi.py:439
2014-01-08 14:15:01.558 5717 INFO trove.common.wsgi [-] Validation error: instance 'volume' is a required property
2014-01-08 14:15:01.558 5717 DEBUG trove.common.wsgi [-] Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/trove/common/wsgi.py", line 319, in execute_action
    self.controller.validate_request(action, action_args)
  File "/usr/lib/python2.7/site-packages/trove/common/wsgi.py", line 466, in validate_request
    raise exception.BadRequest(message=error_msg)
BadRequest: Validation error: instance 'volume' is a required property
 execute_action /usr/lib/python2.7/site-packages/trove/common/wsgi.py:329
2014-01-08 14:15:01.558 5717 DEBUG trove.common.wsgi [-] Caught Trove Error Validation error: instance 'volume' is a required property execute_action /usr/lib/python2.7/site-packages/trove/common/wsgi.py:330
2014-01-08 14:15:01.558 5717 DEBUG trove.common.wsgi [-] Mapped Error to <class 'webob.exc.HTTPBadRequest'> execute_action /usr/lib/python2.7/site-packages/trove/common/wsgi.py:332

The help doesn't mention the volume property and I have no idea what that is.

description: updated
description: updated
Auston McReynolds (amcrn) wrote :

This is referring to the fact that you must pass a "--size" argument for the volume.

The reason why the size argument isn't marked as required in the python-troveclient is that volume-support can be toggled off in Trove via https://github.com/openstack/trove/blob/master/etc/trove/trove.conf.sample#L54.

The message is confusing however, considering it's referring to a 'volume property', when the argument in the cli is 'size' not 'volume'.

Changed in python-troveclient:
assignee: nobody → Auston McReynolds (amcrn)
Auston McReynolds (amcrn) wrote :

After thinking about this for a bit, there are a couple of options.

#1) Change the help text for "--size" (and --datastore, --datastore_version) to indicate that they might be required depending on the deployment.

#2) Add something to the API that returns information about the default_datastore, whether volume_support is True, whether Security Groups are on, etc. The python-troveclient can then query the API, and then use contrib/extensions to surface flags (or modify them) dynamically.

@SlickNik, @vipuls, @hub_cap thoughts? #2 seems like a long-term approach, so perhaps #1 is a necessary stop-gap.

Changed in python-troveclient:
assignee: Auston McReynolds (amcrn) → nobody
status: New → In Progress
Changed in python-troveclient:
importance: Undecided → Low
status: In Progress → Triaged
mariam john (mariamj) on 2014-07-15
Changed in python-troveclient:
assignee: nobody → mariam john (mariamj)
Martin Paulo (martin-paulo) wrote :

From a position of sheer ignorance, what about simply deprecating the 'size' argument and adding a 'volume' argument? That way when somebody hits the error they will at least see the word 'volume' in the list of optional arguments, and see the extra information about it possibly being required?
Also from a position of sheer ignorance, isn't https://bugs.launchpad.net/trove/+bug/1285240 a duplicate of this bug? That there are at least three bug reports on this topic indicates that a simple usability issue is certainly sowing confusion.

Nikhil Manchanda (slicknik) wrote :

Martin: Agreed that this is definitely a usability issue that warrants a fix. I do like the idea of deprecating size, and using volume in the client since that is actually what the parameter is in the JSON payload. Another option is for the client to work with both size, and volume (for backward-compat), but we update all help messages to refer to "volume" instead of "size", thereby minimizing confusion.

Martin Paulo (martin-paulo) wrote :

Making the client work with both size and volume, but changing the help messages to refer to volume sounds like a perfectly acceptable to me.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers