<div dir="ltr">Dan, your arguments conviced me,<div>changing my vote to "request" only.</div></div><div class="gmail_extra"><br clear="all"><div><div dir="ltr"><div>---</div><div>irc: ajo / mangelajo</div>Miguel Angel Ajo Pelayo<br>
+34 636 52 25 69<br>skype: ajoajoajo</div></div>
<br><br><div class="gmail_quote">2014/1/9 Antoni Segura Puimedon <span dir="ltr"><<a href="mailto:asegurap@redhat.com" target="_blank">asegurap@redhat.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><br>
<br>
----- Original Message -----<br>
> From: "Dan Kenigsberg" <<a href="mailto:danken@redhat.com">danken@redhat.com</a>><br>
> To: "Miguel Angel" <<a href="mailto:miguelangel@ajo.es">miguelangel@ajo.es</a>><br>
> Cc: <a href="mailto:dsulliva@redhat.com">dsulliva@redhat.com</a>, <a href="mailto:arch@ovirt.org">arch@ovirt.org</a>, <a href="mailto:vdsm-devel@fedorahosted.org">vdsm-devel@fedorahosted.org</a><br>
</div><div class="im">> Sent: Thursday, January 9, 2014 2:35:40 AM<br>
> Subject: Re: [vdsm] Smarter network_setup hooks<br>
><br>
</div><div><div class="h5">> On Wed, Jan 08, 2014 at 03:34:24PM +0100, Miguel Angel wrote:<br>
> > Hi Assaf, Thank you very much for the summary,<br>
> ><br>
> > Just a few questions, there are things I don't understand yet:<br>
> ><br>
> > 2014/1/8 Assaf Muller <<a href="mailto:amuller@redhat.com">amuller@redhat.com</a>><br>
> ><br>
> > > Mid-thread summary:<br>
> > ><br>
> > > First some terminology so we're all on the same page:<br>
> > > 'request' - The setupNetworks that just arrived<br>
> > > 'running config' - If unified persistence is being used - All networking<br>
> > > on the host as VDSM sees it<br>
> > > 'expected' - If unified persistence is being used - The running config<br>
> > > after the effects of the request, but before the hook is ran<br>
> > ><br>
> > ><br>
> > correct<br>
> ><br>
> ><br>
> > > I think we all agree that we have to expose the 'request' to the hook.<br>
> > > However, there's two different approaches:<br>
> > > 1) Allow the hook to rewrite parts of the request (For example, if two<br>
> > > networks were sent, and the hook handled one of them, it could<br>
> > > then delete that network from the request, so VDSM will only continue<br>
> > > to configure the 2nd network).<br>
> > ><br>
> ><br>
> > In this case ,if the hook deleted the "2nd network", VDSM couldn't handle<br>
> > the network config persistence anymore, right?,<br>
><br>
> Right. If the before_network_setup hook decides to drop an item from the<br>
> 'request', it means that neither following hooks, nor Vdsm proper, would<br>
> see it. I find it as a useful and simple sematics: the hook practically<br>
> says "I'm taking it from here", and from then on, it is repsonsible for<br>
> everything. Implementation and persistence alike.<br>
><br>
> ><br>
> > I didn't expect this use case, I only expected tweaks, etc (before or after<br>
> > network setup), for example, setting special hardware<br>
> > capabilities using ethtool or those kind of things.<br>
><br>
> Neither have I expected this. But it's a powerful tool that's relatively<br>
> easy to implement.<br>
><br>
> ><br>
> > > 2) Toni's idea with marking devices as hook-configured. So if a network<br>
> > > is<br>
> > > over a bridge over a VLAN over a bond over three NICs, hooks<br>
> > > could configure only the NICs (For example) and VDSM would configure<br>
> > > the rest, whereas the first idea means that the hook would<br>
> > > have to configure the entire network (Bridge, VLANs, bonds, and all 3<br>
> > > NICs) and then remove that network from the request.<br>
> > > The disadvantage of this method is that it would be harder to<br>
> > > implement, and have references to the hooks flag throughout all of VDSM.<br>
> > ><br>
> > ><br>
> > You mean that if the hook marked a certain device as "hook handled" then,<br>
> > VDSM would just keep this information along with<br>
> > the network config, etc... and won't do any setup, just config-keeping,<br>
> > right?<br>
><br>
> That's my understanding, too. And I share the feeling that this is error<br>
> prone: Vdsm sees the config, but must remember that it should not touch<br>
> it or act upon it.<br>
><br>
> > > Then there's the matter of IF to expose the 'running config' and<br>
> > > 'expected'.<br>
> > ><br>
> > > My main argument is that it's very easy to expose to the hooks (But then<br>
> > > why not expose other 'random' data that is easy for VDSM to calculate?),<br>
> > > and that we don't understand all usages for the setupNetworks hooks. I'd<br>
> > > rather we expose too much information than not enough and screw<br>
> > > over hook writers.<br>
> > ><br>
> > ><br>
> > We have something important here, the hooks don't need to be<br>
> > python-written, they could be bash scripts, or any other thing...<br>
> > that means that they wouldn't have access to get "running config", but they<br>
> > could calculate "expected".<br>
> ><br>
> > So, my vote here goes for "request" + "running config".<br>
> ><br>
><br>
> The "running config" is accessible to any process, albeit not in its<br>
> Vdsm representation. All the information is available if you do `ip a`<br>
> and `virsh net-list`.<br>
><br>
> I do not imagine why a hook would need the "running config"; If it does<br>
> end up needing it, it could re-calculate it just as Vdsm does. Passing<br>
> this as argument to each hook script is a premature optimization imho.<br>
><br>
> If I end up wrong, it would not be hard to add the "running config" to<br>
> the Vdsm/hook API. Removing something from an API is a much harder<br>
> task.<br>
><br>
> My vote goes to only "request".<br>
<br>
</div></div>Only "request" for me too.<br>
<div class="im HOEnZb">><br>
> ><br>
> > > Either way, let's get some votes in a timely manner so we could manage to<br>
> > > implement this for 3.4.<br>
> > ><br>
> > ><br>
> > Thanks Assaf! ;)<br>
</div><div class="HOEnZb"><div class="h5">> _______________________________________________<br>
> vdsm-devel mailing list<br>
> <a href="mailto:vdsm-devel@lists.fedorahosted.org">vdsm-devel@lists.fedorahosted.org</a><br>
> <a href="https://lists.fedorahosted.org/mailman/listinfo/vdsm-devel" target="_blank">https://lists.fedorahosted.org/mailman/listinfo/vdsm-devel</a><br>
><br>
</div></div></blockquote></div><br></div>