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.
2015-06-05 13:42 GMT+08:00 Eric Windisch <e...@windisch.us>: > >>> 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. >>> >>> 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). >>> >>> >>> Cool idea! >>> >> 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. >> > > 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. > > Taking from the dev-quickstart, I've changed the instructions for creating > a container according to how this could work using uuid5: > > $ magnum create-bay --name swarmbay --baymodel testbaymodel > $ BAY_UUID=$(python -c "import uuid; print > uuid.uuid5(uuid.UUID('urn:uuid:${TENANT_ID}'), 'swarmbay')") > $ cat > ~/container.json << END > { > "bay_uuid": "$BAY_UUID", > "name": "test-container", > "image_id": "cirros", > "command": "ping -c 4 8.8.8.8" > } > END > $ magnum container-create < ~/container.json > > > 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. > > Regards, > Eric Windisch > > __________________________________________________________________________ > OpenStack Development Mailing List (not for usage questions) > Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe > http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev > > -- Thanks, Jay Lau (Guangya Liu)
__________________________________________________________________________ OpenStack Development Mailing List (not for usage questions) Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev