<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif; ">
<div>Hi Tim,</div>
<div>I do think your recommendation in 3 & 4 makes a lot of sense and improves the usability of the API.  Given that Trove currently only supports a single datastore deployment per control system, does the current work also allow for a default type/version
 to be defined so that operators of Trove can set this as a property to maintain the current API compatibility/behavior?</div>
<div><br>
</div>
<div>Josh </div>
<div><br>
</div>
<div><br>
</div>
<span id="OLK_SRC_BODY_SECTION">
<div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<span style="font-weight:bold">From: </span>Tim Simpson <<a href="mailto:tim.simpson@rackspace.com">tim.simpson@rackspace.com</a>><br>
<span style="font-weight:bold">Reply-To: </span>OpenStack Development Mailing List <<a href="mailto:openstack-dev@lists.openstack.org">openstack-dev@lists.openstack.org</a>><br>
<span style="font-weight:bold">Date: </span>Friday, October 18, 2013 2:30 PM<br>
<span style="font-weight:bold">To: </span>"<a href="mailto:openstack-dev@lists.openstack.org">openstack-dev@lists.openstack.org</a>" <<a href="mailto:openstack-dev@lists.openstack.org">openstack-dev@lists.openstack.org</a>><br>
<span style="font-weight:bold">Subject: </span>[openstack-dev] [Trove] How users should specify a datastore type when creating an instance<br>
</div>
<div><br>
</div>
<blockquote id="MAC_OUTLOOK_ATTRIBUTION_BLOCKQUOTE" style="BORDER-LEFT: #b5c4df 5 solid; PADDING:0 0 0 5; MARGIN:0 0 0 5;">
<div dir="ltr"><style type="text/css" id="owaParaStyle"></style>
<div fpstyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">
<div>Hello fellow Trovians,</div>
<div><br>
</div>
<div>There has been some good work recently to figure out a way to specify a specific datastore  when using Trove. This is essential to supporting multiple datastores from the same install of Trove.</div>
<div><br>
</div>
<div>I have an issue with some elements of the proposed solution though, so I decided I'd start a thread here so we could talk about it.</div>
<div><br>
</div>
<div>As a quick refresher, here is the blue print for this work (there are some gists ammended to the end but I figured the mailing list would be an easier venue for discussion):</div>
<div><a href="https://wiki.openstack.org/wiki/Trove/trove-versions-types">https://wiki.openstack.org/wiki/Trove/trove-versions-types</a></div>
<div><br>
</div>
<div>One issue I have is with the way the instance create call will change to support different data stores. For example, here is the post call:</div>
<div><br>
</div>
<div>"""</div>
<div>{</div>
<div>      "instance" : {</div>
<div>      "flavorRef" : "2",</div>
<div>      "name" : "as",</div>
<div>      "datastore_type" : "e60153d4-8ac4-414a-ad58-fe2e0035704a",</div>
<div>      "datastore_version" : "94ed1f9f-6c1a-4d6e-87e9-04ecff37b64b",</div>
<div>      "volume" : { "size" : "1" }</div>
<div>    }</div>
<div>}</div>
<div>"""</div>
<div><br>
</div>
<div>1. I think since we have two fields in the instance object we should make a new object for datastore and avoid the name prefixing, like this:</div>
<div><br>
</div>
<div>"""</div>
<div>{</div>
<div>     "instance" : {</div>
<div>      "flavorRef" : "2",</div>
<div>      "name" : "as",</div>
<div>      "datastore": {</div>
<div>            "type" : "e60153d4-8ac4-414a-ad58-fe2e0035704a",</div>
<div>            "version" : "94ed1f9f-6c1a-4d6e-87e9-04ecff37b64b"</div>
<div>      }</div>
<div>      "volume" : { "size" : "1" }</div>
<div>    }</div>
<div>}</div>
<div>"""</div>
<div><br>
</div>
<div>2. I also think a datastore_version alone should be sufficient since the associated datastore type will be implied:</div>
<div><br>
</div>
<div>"""</div>
<div>{</div>
<div>      "instance" : {</div>
<div>      "flavorRef" : "2",</div>
<div>      "name" : "as",</div>
<div>      "datastore": {</div>
<div>            "version" : "94ed1f9f-6c1a-4d6e-87e9-04ecff37b64b"</div>
<div>      }</div>
<div>      "volume" : { "size" : "1" }</div>
<div>    }</div>
<div>}</div>
<div>"""</div>
<div><br>
</div>
<div>3. Additionally, while a datastore_type should have an ID in the Trove infastructure database, it should also be possible to pass just the name of the datastore type to the instance call, such as "mysql" or "mongo". Maybe we could allow this in addition
 to the ID? I think this form should actually use the argument "type", and the id should then be passed as "type_id" instead.</div>
<div><br>
</div>
<div>"""</div>
<div>{</div>
<div>      "instance" : {</div>
<div>      "flavorRef" : "2",</div>
<div>      "name" : "as",</div>
<div>      "datastore": {</div>
<div>            "type" : "mysql",</div>
<div>            "version" : "94ed1f9f-6c1a-4d6e-87e9-04ecff37b64b"</div>
<div>      } </div>
<div>      "volume" : { "size" : "1" }</div>
<div>    }</div>
<div>}</div>
<div><br>
</div>
<div>"""</div>
<div><br>
</div>
<div>4. Additionally, in the current pull request to implement this it is possible to avoid passing a version, but only if no more than one version of the datastore_type exists in the database. </div>
<div><br>
</div>
<div>I think instead the datastore_type row in the database should also have a "default_version_id" property, that an operator could update to the most recent version or whatever other criteria they wish to use, meaning the call could become this simple:</div>
<div><br>
</div>
<div>"""</div>
<div>{</div>
<div>      "instance" : {</div>
<div>      "flavorRef" : "2",</div>
<div>      "name" : "as",</div>
<div>      "datastore": {</div>
<div>            "type" : "mysql"</div>
<div>      } </div>
<div>      "volume" : { "size" : "1" }</div>
<div>    }</div>
<div>}</div>
<div>"""</div>
<div><br>
</div>
<div>Thoughts?</div>
<div><br>
</div>
<div>Thanks,</div>
<div><br>
</div>
<div>Tim</div>
</div>
</div>
</div>
</blockquote>
</span>
</body>
</html>