<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style>
<!--
@font-face
        {font-family:Wingdings}
@font-face
        {font-family:Wingdings}
@font-face
        {font-family:Calibri}
@font-face
        {font-family:Tahoma}
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif"}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline}
span.EmailStyle17
        {font-family:"Calibri","sans-serif";
        color:#1F497D}
.MsoChpDefault
        {font-family:"Calibri","sans-serif"}
@page WordSection1
        {margin:72.0pt 72.0pt 72.0pt 72.0pt}
-->
</style><style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1" vlink="purple" lang="EN-US" link="blue">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Would it make sense to simply have the neutron metadata service re-export every endpoint listed in keystone at /openstack/api/<endpoint-name>?<br>
<br>
Thanks,<br>
Kevin<br>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div style="direction: ltr;" id="divRpF56675"><font size="2" face="Tahoma" color="#000000"><b>From:</b> Murray, Paul (HP Cloud Services) [pmurray@hp.com]<br>
<b>Sent:</b> Friday, January 24, 2014 11:04 AM<br>
<b>To:</b> OpenStack Development Mailing List (not for usage questions)<br>
<b>Subject:</b> Re: [openstack-dev] [Nova] bp proposal: discovery of peer instances through metadata service<br>
</font><br>
</div>
<div></div>
<div>
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D">Hi Justin,</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D">It’s nice to see someone bringing this kind of thing up. Seeding discovery is a handy primitive to have.</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D">Multicast is not generally used over the internet, so the comment about removing multicast is not really justified, and any of the approaches that work there
 could be used. Alternatively your instances could use the nova or neutron APIs to obtain any information you want – if they are network connected – but certainly whatever is starting them has access, so something can at least provide the information.</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D">I agree that the metadata service is a sensible alternative. Do you imagine your instances all having access to the same metadata service? Is there something
 more generic and not tied to the architecture of a single openstack deployment?</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D">Although this is a simple example, it is also the first of quite a lot of useful primitives that are commonly provided by configuration services. As it is
 possible to do what you want by other means (including using an implementation that has multicast within subnets – I’m sure neutron does actually have this), it seems that this makes less of a special case and rather a requirement for a more general notification
 service?</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D">Having said that I do like this kind of stuff
</span><span style="font-size:11.0pt; font-family:Wingdings; color:#1F497D">J</span><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D"></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D">Paul.</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D"> </span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif""> Justin Santa Barbara [mailto:justin@fathomdb.com]
<br>
<b>Sent:</b> 24 January 2014 15:43<br>
<b>To:</b> OpenStack Development Mailing List (not for usage questions)<br>
<b>Subject:</b> Re: [openstack-dev] [Nova] bp proposal: discovery of peer instances through metadata service</span></p>
<p class="MsoNormal"> </p>
<div>
<div>
<p class="MsoNormal">Good points - thank you.  For arbitrary operations, I agree that it would be better to expose a token in the metadata service, rather than allowing the metadata service to expose unbounded amounts of API functionality.  We should therefore
 also have a per-instance token in the metadata, though I don't see Keystone getting the prerequisite IAM-level functionality for two+ releases (?).<br>
<br>
However, I think I can justify peer discovery as the 'one exception'.  Here's why: discovery of peers is widely used for self-configuring clustered services, including those built in pre-cloud days.  Multicast/broadcast used to be the solution, but cloud broke
 that.  The cloud is supposed to be about distributed systems, yet we broke the primary way distributed systems do peer discovery. Today's workarounds are pretty terrible, e.g. uploading to an S3 bucket, or sharing EC2 credentials with the instance (tolerable
 now with IAM, but painful to configure).  We're not talking about allowing instances to program the architecture (e.g. attach volumes etc), but rather just to do the equivalent of a multicast for discovery.  In other words, we're restoring some functionality
 we took away (discovery via multicast) rather than adding programmable-infrastructure cloud functionality.<br>
<br>
We expect the instances to start a gossip protocol to determine who is actually up/down, who else is in the cluster, etc.  As such, we don't need accurate information - we only have to help a node find one living peer.  (Multicast/broadcast was not entirely
 reliable either!)  Further, instance #2 will contact instance #1, so it doesn’t matter if instance #1 doesn’t have instance #2 in the list, as long as instance #2 sees instance #1.  I'm relying on the idea that instance launching takes time > 0, so other instances
 will be in the starting state when the metadata request comes in, even if we launch instances simultaneously.  (Another reason why I don't filter instances by state!)<br>
<br>
I haven't actually found where metadata caching is implemented, although the constructor of InstanceMetadata documents restrictions that really only make sense if it is.  Anyone know where it is cached?<br>
<br>
In terms of information exposed: An alternative would be to try to connect to every IP in the subnet we are assigned; this blueprint can be seen as an optimization on that (to avoid DDOS-ing the public clouds).  So I’ve tried to expose only the information
 that enables directed scanning: availability zone, reservation id, security groups, network ids & labels & cidrs & IPs [example below].  A naive implementation will just try every peer; a smarter implementation might check the security groups to try to filter
 it, or the zone information to try to connect to nearby peers first.  Note that I don’t expose e.g. the instance state: if you want to know whether a node is up, you have to try connecting to it.  I don't believe any of this information is at all sensitive,
 particularly not to instances in the same project.<br>
<br>
On external agents doing the configuration: yes, they could put this into user defined metadata, but then we're tied to a configuration system.  We have to get 20 configuration systems to agree on a common format (Heat, Puppet, Chef, Ansible, SaltStack, Vagrant,
 Fabric, all the home-grown systems!)  It also makes it hard to launch instances concurrently (because you want node #2 to have the metadata for node #1, so you have to wait for node #1 to get an IP).<br>
<br>
More generally though, I have in mind a different model, which I call 'configuration from within' (as in 'truth comes from within'). I don’t want a big imperialistic configuration system that comes and enforces its view of the world onto primitive machines.
  I want a smart machine that comes into existence, discovers other machines and cooperates with them.  This is the Netflix pre-baked AMI concept, rather than the configuration management approach.<br>
<br>
The blueprint does not exclude 'imperialistic' configuration systems, but it does enable e.g. just launching N instances in one API call, or just using an auto-scaling group.  I suspect the configuration management systems would prefer this to having to implement
 this themselves.<br>
<br>
(Example JSON below)<br>
<br>
Justin<br>
<br>
---<br>
<br>
Example JSON:<br>
<br>
<span style="font-family:"Courier New"">[<br>
    {<br>
        "availability_zone": "nova",<br>
        "network_info": [<br>
            {<br>
                "id": "e60bbbaf-1d2e-474e-bbd2-864db7205b60",<br>
                "network": {<br>
                    "id": "f2940cd1-f382-4163-a18f-c8f937c99157",<br>
                    "label": "private",<br>
                    "subnets": [<br>
                        {<br>
                            "cidr": "<a href="http://10.11.12.0/24" target="_blank">10.11.12.0/24</a>",<br>
                            "ips": [<br>
                                {<br>
                                    "address": "10.11.12.4",<br>
                                    "type": "fixed",<br>
                                    "version": 4<br>
                                }<br>
                            ],<br>
                            "version": 4<br>
                        },<br>
                        {<br>
                            "cidr": null,<br>
                            "ips": [],<br>
                            "version": null<br>
                        }<br>
                    ]<br>
                }<br>
            }<br>
        ],<br>
        "reservation_id": "r-44li8lxt",<br>
        "security_groups": [<br>
            {<br>
                "name": "default"<br>
            }<br>
        ],<br>
        "uuid": "2adcdda2-561b-494b-a8f6-378b07ac47a4"<br>
    },<br>
<br>
<i>… (the above is repeated for every instance)…</i><br>
]<br>
</span><br>
<br>
<br>
<br>
On Fri, Jan 24, 2014 at 8:43 AM, Day, Phil <<a href="mailto:philip.day@hp.com" target="_blank">philip.day@hp.com</a>> wrote:<br>
> Hi Justin,<br>
><br>
>  <br>
><br>
> I can see the value of this, but I’m a bit wary of the metadata service<br>
> extending into a general API – for example I can see this extending into a<br>
> debate about what information needs to be made available about the instances<br>
> (would you always want all instances exposed, all details, etc) – if not<br>
> we’d end up starting to implement policy restrictions in the metadata<br>
> service and starting to replicate parts of the API itself.<br>
><br>
>  <br>
><br>
> Just seeing instances launched before me doesn’t really help if they’ve been<br>
> deleted (but are still in the cached values) does it ?<br>
><br>
>  <br>
><br>
> Since there is some external agent creating these instances, why can’t that<br>
> just provide the details directly as user defined metadata ?<br>
><br>
>  <br>
><br>
> Phil<br>
><br>
>  <br>
><br>
> From: Justin Santa Barbara [mailto:<a href="mailto:justin@fathomdb.com" target="_blank">justin@fathomdb.com</a>]<br>
> Sent: 23 January 2014 16:29<br>
> To: OpenStack Development Mailing List<br>
> Subject: [openstack-dev] [Nova] bp proposal: discovery of peer instances<br>
> through metadata service<br>
><br>
>  <br>
><br>
> Would appreciate feedback / opinions on this blueprint:<br>
> <a href="https://blueprints.launchpad.net/nova/+spec/first-discover-your-peers" target="_blank">
https://blueprints.launchpad.net/nova/+spec/first-discover-your-peers</a><br>
><br>
>  <br>
><br>
> The idea is: clustered services typically run some sort of gossip protocol,<br>
> but need to find (just) one peer to connect to.  In the physical<br>
> environment, this was done using multicast.  On the cloud, that isn't a<br>
> great solution.  Instead, I propose exposing a list of instances in the same<br>
> project, through the metadata service.<br>
><br>
>  <br>
><br>
> In particular, I'd like to know if anyone has other use cases for instance<br>
> discovery.  For peer-discovery, we can cache the instance list for the<br>
> lifetime of the instance, because it suffices merely to see instances that<br>
> were launched "before me".  (peer1 might not join to peer2, but peer2 will<br>
> join to peer1).  Other use cases are likely much less forgiving!<br>
><br>
><br>
> Justin<br>
><br>
><br>
><br>
> _______________________________________________<br>
> OpenStack-dev mailing list<br>
> <a href="mailto:OpenStack-dev@lists.openstack.org" target="_blank">OpenStack-dev@lists.openstack.org</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>
></p>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>