[openstack-dev] [magnum] Nesting /containers resource under /bays
kyle.kelley at RACKSPACE.COM
Thu Jan 14 16:38:38 UTC 2016
This presumes a model where Magnum is in complete control of the IDs of individual containers. How does this work with the Docker daemon?
> In Rest API, you can set the “uuid” field in the json request body (this is not supported in CLI, but it is an easy add).
In the Rest API for Magnum or Docker? Has Magnum completely broken away from exposing native tooling - are all container operations assumed to be routed through Magnum endpoints?
> For the idea of nesting container resource, I prefer not to do that if there are alternatives or it can be work around. IMO, it sets a limitation that a container must have a bay, which might not be the case in future. For example, we might add a feature that creating a container will automatically create a bay. If a container must have a bay on creation, such feature is impossible.
If that's *really* a feature you need and are fully involved in designing for, this seems like a case where creating a container via these endpoints would create a bay and return the full resource+subresource.
Personally, I think these COE endpoints need to not be in the main spec, to reduce the surface area until these are put into further use.
From: Hongbin Lu <hongbin.lu at huawei.com>
Sent: Wednesday, January 13, 2016 5:00 PM
To: OpenStack Development Mailing List (not for usage questions)
Subject: Re: [openstack-dev] [magnum] Nesting /containers resource under /bays
I would like to clarify several things.
First, a container uuid is intended to be unique globally (not within individual cluster). If you create a container with duplicated uuid, the creation will fail regardless of its bay. Second, you are in control of the uuid of the container that you are going to create. In Rest API, you can set the “uuid” field in the json request body (this is not supported in CLI, but it is an easy add). If a uuid is provided, Magnum will use it as the uuid of the container (instead of generating a new uuid).
For the idea of nesting container resource, I prefer not to do that if there are alternatives or it can be work around. IMO, it sets a limitation that a container must have a bay, which might not be the case in future. For example, we might add a feature that creating a container will automatically create a bay. If a container must have a bay on creation, such feature is impossible.
From: Jamie Hannaford [mailto:jamie.hannaford at rackspace.com]
Sent: January-13-16 4:43 AM
To: openstack-dev at lists.openstack.org
Subject: [openstack-dev] [magnum] Nesting /containers resource under /bays
I've recently been gathering feedback about the Magnum API and one of the things that people commented on was the global /containers endpoints. One person highlighted the danger of UUID collisions:
It takes a container ID which is intended to be unique within that individual cluster. Perhaps this doesn't matter, considering the surface for hash collisions. You're running a 1% risk of collision on the shorthand container IDs:
In : n = lambda p,H: math.sqrt(2*H * math.log(1/(1-p)))
In : n(.01, 0x1000000000000)
(this comes from the Birthday Attack - https://en.wikipedia.org/wiki/Birthday_attack)<https://en.wikipedia.org/wiki/Birthday_attack>
The main reason I questioned this is that we're not in control of how the hashes are created whereas each Docker node or Swarm cluster will pick a new ID under collisions. We don't have that guarantee when aggregating across.
The use case that was outlined appears to be aggregation and reporting. That can be done in a different manner than programmatic access to single containers.
Representing a resource without reference to its parent resource also goes against the convention of many other OpenStack APIs.
Nesting a container resource under its parent bay would mitigate both of these issues:
I'd like to get feedback from folks in the Magnum team and see if anybody has differing opinions about this.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the OpenStack-dev