<br><br><div class="gmail_quote">On Tue, Jun 5, 2012 at 12:59 PM, Nick Barcet <span dir="ltr"><<a href="mailto:nick.barcet@canonical.com" target="_blank">nick.barcet@canonical.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On 06/05/2012 04:44 PM, Doug Hellmann wrote:<br>
> On Tue, Jun 5, 2012 at 10:41 AM, Doug Hellmann<br>
</div><div class="im">> <<a href="mailto:doug.hellmann@dreamhost.com">doug.hellmann@dreamhost.com</a> <mailto:<a href="mailto:doug.hellmann@dreamhost.com">doug.hellmann@dreamhost.com</a>>> wrote:<br>
>     On Tue, Jun 5, 2012 at 9:56 AM, Nick Barcet<br>
</div><div class="im">>     <<a href="mailto:nick.barcet@canonical.com">nick.barcet@canonical.com</a> <mailto:<a href="mailto:nick.barcet@canonical.com">nick.barcet@canonical.com</a>>> wrote:<br>
><br>
>         Following up on our last meeting, here is a proposal for centrally<br>
>         hosting configuration of agents in ceilometer.<br>
><br>
>         The main idea is that all agents of a given type should be sending<br>
>         similarly formatted information in order for the information to be<br>
>         usable, hence the need to ensure that configuration info is<br>
>         centrally<br>
>         stored and retrieved.  This would rule out, in my mind, the idea<br>
>         that we<br>
>         could use the global flags object, as distribution of the<br>
>         configuration<br>
>         file is left to the cloud implementor and does not lend for easy and<br>
>         synchronized updates of agent config.<br>
><br>
>         Configuration format and content is left to the agent's<br>
>         implementation,<br>
>         but it is assumed that each meter covered by an agent can be :<br>
>          * enabled or disabled<br>
>          * set to send information at a specified interval.<br>
><br>
><br>
>     Right now we only have one interval for all polling. Do you think we<br>
>     need to add support for polling different values at different<br>
>     intervals? Do we need other per-agent settings, or are all of the<br>
>     settings the same for all agents? (I had assumed the latter would be<br>
>     all we needed.)<br>
<br>
</div>I would have thought that we may want to support different intervals per<br>
meters, based on the billing rules that one may want to offer.  For<br>
example, I may want to bill compute by the hour but floating IPs by the<br>
day, hence have a different reporting interval for each.<br></blockquote><div><br></div><div>I was planning to aggregate the values for items being billed over the longer time frames, but we can make the polling interval configurable. It will take some work, because of the way the scheduled tasks are configured in the service and manager (right now we just schedule one method to run, and it invokes each pollster).</div>
<div><br></div><div>How important is it to include this in Folsom?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><br>
>         1/ Configuration is stored for each agent in the database as follow<br>
>         +-------------------------------------------------------------------+<br>
>         | Field     | Type     | Note<br>
>             |<br>
>         +-------------------------------------------------------------------+<br>
>         | AgentType | String   | Unique agent type<br>
>            |<br>
>         | ConfVers  | Integer  | Version of the configuration<br>
>             |<br>
>         | Config    | Text     | JSON Configuration info (defined by<br>
>         agent) |<br>
>         +-----------+----------+--------------------------------------------+<br>
><br>
>         2/ Config is retreived via the messaging queue upon boot once a day<br>
>         (this should be defined in the global flags object) to check if the<br>
>         config has changed.<br>
><br>
><br>
>     Updating the config once a day is not going to be enough in an<br>
>     environment with a lot of compute nodes.<br>
><br>
><br>
> Two thoughts merged into one sentence there. Need more caffeine.<br>
><br>
> What I was trying to say, was that updating the config once a day might<br>
</div>> not be enough and in environments with a lot of compute nodes going<br>
<div class="im">> around to manually restart the services each time the config changes<br>
> will be a pain. See below for more discussion of pushing config settings<br>
> out.<br>
<br>
</div>Agreed, and that's why I proposed that the interval for confguration<br>
refresh should be set in the Global object flag (this is something that<br>
can be shared among all the agents).<br>
<div class="im"><br>
><br>
><br>
>         Request sent by the agent upon boot and :<br>
><br>
>            'reply_to': 'get_config_data',<br>
>            'correlation_id': xxxxx<br>
>            'version': '1.0',<br>
>            'args': {'data': {<br>
>                       'AgentType': agent.type,<br>
>                       'CurrentVersion': agent.version,<br>
>                       'ConfigDefault': agent.default,<br>
>                       },<br>
>                    },<br>
><br>
><br>
>     Is this a standard OpenStack RPC call?<br>
<br>
</div>Not sure about that, but if it can be, it would be easier :)<br></blockquote><div><br></div><div>Yeah, I think a regular RPC call would be the easiest implementation. So we still need to specify the arguments to that call, but we don't have to worry about how the messages travel back and forth.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><br>
>         Where ConfigDefault are the "sane" default proposed by the agent<br>
>         authors.<br>
><br>
><br>
>     Why is the agent proposing default settings?<br>
<br>
</div>So that the first agent of a given type can populate its info with sane<br>
defaults that can then be edited later on?<br></blockquote><div><br></div><div>If the agent plugins are installed on the server where the collector is located, the collector can ask them for defaults.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="im"><br>
>         If no config record is found the collector creates the record, sets<br>
>         ConfVers to 1 and sends back a normal reply.<br>
><br>
>         Reply sent by the collector:<br>
>            'correlation_id': xxxxx<br>
>            'version': '1.0',<br>
><br>
><br>
>     Do we need minor versions for the config settings, or are those<br>
>     simple sequence numbers to track which settings are the "most current"?<br>
<br>
</div>Simple sequence was what I was thinking about.<br></blockquote><div><br></div><div>Wouldn't it be simpler if the configuration settings were pushed to the agent as an idempotent operation?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="im"><br>
>            'args': {'data': {<br>
>                       'Result': result.code,<br>
>                       'ConfVers': ConfVers,<br>
>                       'Config': Config,<br>
>                       },<br>
>                    },<br>
>            }<br>
><br>
>         Result is set as follow:<br>
>            200  -> Config was retrieved successfully<br>
>            201  -> Config was created based on received default (Config<br>
>         is empty)<br>
>            304  -> Config version is identical to CurrentVersion (Config<br>
>         is empty)<br>
><br>
><br>
>     Why does the agent need to know the difference between those?<br>
>     Shouldn't it simply use the settings it is given?<br>
<br>
</div>To avoid processing update code if the update is not needed?<br></blockquote><div><br></div><div>That optimization doesn't need to be built into the protocol, though. The only way to get that right is for the central server to have a representation of the state of the configuration of each agent. It is simpler for the agent to ask the collector, "what should my configuration be?" and then handle the changes locally.</div>
<div><br></div><div>The simplest implementation will be to just throw away all of the pollsters and instantiate new ones when the configuration changes. It isn't expensive to construct those objects, and doing it this way should be easier to implement than trying to adjust settings (especially the schedule).</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><br>
>         This leaves open the question of having some UI to change the<br>
>         config,<br>
>         but I thing we can live with manual updating of the records for<br>
>         the time<br>
>         being.<br>
><br>
><br>
>     Since we're using the service and RPC frameworks from nova<br>
>     elsewhere, we have the option of issuing commands to all of the<br>
>     agents from a central server. That would let us, for example, use a<br>
>     cast() call to push a new configuration out to all of the agents at<br>
>     once, on demand (from a command line program, for example).<br>
<br>
</div>Sounds nifty.  Let's amend.<br>
<div class="im"><br>
>     I don't see the need for storing the configuration in the database.<br>
>     It seems just as easy to have a configuration file on the central<br>
>     server. The collector could read the file each time it is asked for<br>
>     the agent configuration, and the command line program that pushes<br>
>     config changes out could do the same.<br>
<br>
</div>Over engineering on my side, maybe.  You are right that the database is<br>
NOT needed and we can do with a simple file, but then the collector<br>
becomes state-full and HA considerations will start kicking in if we<br>
want to have 2 collectors running in //.  If the DB is shared, the issue<br>
is pushed to the DB, which will, hopefully, be redundant by nature.<br></blockquote><div><br></div><div>That's a reasonable point. I assumed the collector configuration is going to need to be shared among those nodes already. How does that work in other OpenStack components?</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><br>
>     Have you given any thought to distributing the secret value used for<br>
>     signing incoming messages? A central configuration authority does<br>
>     not give us a secure way to deliver secrets like that. If anyone<br>
>     with access to the message queue can retrieve the key by sending RPC<br>
>     requests, we might as well not sign the messages.<br>
<br>
</div>Actually, the private key used to generate a signature should be unique<br>
to each host, if we want them to have any value at all, therefore<br>
distributing a common signature should NOT be part of this, or we would<br>
fall under the notion of a shared secret, which is, IMHO, not any better<br>
than having a global password.<br>
<br>
I would recommend that, for the time being, we just generate a random<br>
key pair per host the first time the agent is run, allowing for someone<br>
with further requirement to eventually populate this value by another<br>
mean.<br>
<br>
In any case, if we want to effectively check the signature, the public<br>
key does need to be accessible by the collector to check it and have yet<br>
to define a way to do so...  Proposals welcome, but again, while I think<br>
we should lay the ground for a great security experience, we certainly<br>
don't need to solve it all in v1.<br></blockquote><div><br></div><div>The current implementation uses hmac message signatures, which use a shared secret instead of public/private key pairs. We can have a separate secret for each agent, but we still need the collector(s) to have them all. I thought the point of signing the messages was to prevent an arbitrary agent from signing on to the message queue and sending bogus data. Do we need to be doing more than hmac for security?</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class="HOEnZb"><font color="#888888"><br>
Nick<br>
<br>
</font></span></blockquote></div><br>