<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none"><!-- p { margin-top: 0px; margin-bottom: 0px; }--></style>
</head>
<body dir="ltr" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>I've recently been gathering feedback about the Magnum API and one of the things that people commented on​ was the global /containers endpoints. <span style="font-size: 12pt;">One person highlighted the danger of UUID collisions:</span></p>
<p><span style="font-size: 12pt;"><br>
</span></p>
<p><span style="font-size: 12pt;">"""</span></p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;"><span style="font-size: 12pt;">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:</span></p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;"><span style="font-size: 12pt;"><br>
</span></p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;"><span style="font-size: 12pt;">In [14]: n = lambda p,H: math.sqrt(2*H * math.log(1/(1-p)))<br>
<br>
</span></p>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
In [15]: n(.01, 0x1000000000000)</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
Out[15]: 2378620.6298183016<br>
</div>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;"><span style="font-size: 12pt;"><br>
</span></p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;"><span style="font-size: 12pt;">(this comes from the Birthday Attack - <a href="https://en.wikipedia.org/wiki/Birthday_attack" target="_blank">https://en.wikipedia.org/wiki/Birthday_attack)</a></span></p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;"><span style="font-size: 12pt;"><br>
</span></p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;"><span style="font-size: 12pt;">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.</span></p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;"><br>
</p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">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.​<br>
</p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">"""<br>
</p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;"><br>
</p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">Representing a resource without reference to its parent resource also goes against the convention of many other OpenStack APIs.<br>
</p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;"><br>
</p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">Nesting a container resource under its parent bay would mitigate both of these issues:<br>
</p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;"><br>
</p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">/bays/{uuid}/containers/{uuid}​<br>
</p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;"><br>
</p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">I'd like to get feedback from folks in the Magnum team and see if anybody has differing opinions about this.<br>
</p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;"><br>
</p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">Jamie</p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;"><br>
</p>
<p><span style="font-size: 12pt;"><br>
</span></p>
   
<hr>
Rackspace International GmbH a company registered in the Canton of Zurich, Switzerland (company identification number CH-020.4.047.077-1) whose registered office is at Pfingstweidstrasse 60, 8005 Zurich, Switzerland. Rackspace International GmbH privacy policy
 can be viewed at www.rackspace.co.uk/legal/swiss-privacy-policy - This e-mail message may contain confidential or privileged information intended for the recipient. Any dissemination, distribution or copying of the enclosed material is prohibited. If you receive
 this transmission in error, please notify us immediately by e-mail at abuse@rackspace.com and delete the original message. Your cooperation is appreciated.
</body>
</html>