<div dir="ltr">Thanks Eric, I see. Yes, this can make sure the user would not need to contact the server using bay-show/baymode-show to get UUID of bay/baymodel, but Magnum need to be updated to make the bay/baymodel uuid generate logic. <br></div><div class="gmail_extra"><br><div class="gmail_quote">2015-06-05 13:42 GMT+08:00 Eric Windisch <span dir="ltr"><<a href="mailto:eric@windisch.us" target="_blank">eric@windisch.us</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div class="gmail_extra"><div class="gmail_quote"><span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div><span><br>
<blockquote type="cite">
<div>
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">
<div>I think this is perfectly fine, as long as it's reasonably large and the algorithm is sufficiently intelligent. The UUID algorithm is good at this, for instance, although it fails at readability. Docker's is not terribly great and could be limiting
if you were looking to run several thousand containers on a single machine. Something better than Docker's algorithm but more readable than UUID could be explored.</div>
<div><br>
</div>
<div>Also, something to consider is if this should also mean a change to the UUIDs themselves. You could use UUID-5 to create a UUID from your tenant's UUID and your unique name. The tenant's UUID would be the namespace, with the bay's name being the
"name" field. The benefit of this is that clients, by knowing their tenant ID could automatically determine their bay ID, while also guaranteeing uniqueness (or as unique as UUID gets, anyway).</div>
</div>
</div>
</div>
</div>
</blockquote>
<div><br>
</div></span>
Cool idea!</div></div></div></blockquote></span><div>I'm clear with the solution, but still have some questions: So we need to set the bay/baymodel name in the format of UUID-name format? Then if we get the tenant ID, we can use "magnum bay-list | grep <tenant-id>" or some other filter logic to get all the bays belong to the tenant? By default, the "magnum bay-list/baymodel-list" will only show the bay/baymodels for one specified tenant.</div></div></div></div></div></blockquote><div><br></div></span><div>The name would be an arbitrary string, but you would also have a unique-identifier which is a UUID. I'm proposing the UUID could be generated using the UUID5 algorithm which is basically sha1(tenant_id + unique_name) converted into a GUID. The Python uuid library can do this easily, out of the box.</div><div><br></div><div>Taking from the dev-quickstart, I've changed the instructions for creating a container according to how this could work using uuid5:</div><div><br></div>$ magnum create-bay --name swarmbay --baymodel testbaymodel<br>$ BAY_UUID=$(python -c "import uuid; print uuid.uuid5(uuid.UUID('urn:uuid:${TENANT_ID}'), 'swarmbay')")<br>$ cat > ~/container.json << END<br>{<br> "bay_uuid": "$BAY_UUID",<br> "name": "test-container",<br> "image_id": "cirros",<br> "command": "ping -c 4 8.8.8.8"<br>}<br>END<br>$ magnum container-create < ~/container.json
<div><br></div><div><br></div><div>The key difference in this example, of course, is that users would not need to contact the server using bay-show in order to obtain the UUID of their bay.</div><div><br></div><div>Regards,</div><div>Eric Windisch</div></div></div></div>
<br>__________________________________________________________________________<br>
OpenStack Development Mailing List (not for usage questions)<br>
Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Thanks,<br><br></div>Jay Lau (Guangya Liu)<br></div></div></div></div>
</div>