<font size=2 face="sans-serif">Consider the example at </font><a href=https://docs.google.com/drawings/d/1nridrUUwNaDrHQoGwSJ_KXYC7ik09wUuV3vXw1MyvlY><font size=2 face="sans-serif">https://docs.google.com/drawings/d/1nridrUUwNaDrHQoGwSJ_KXYC7ik09wUuV3vXw1MyvlY</font></a>
<br>
<br><font size=2 face="sans-serif">We could indeed have distinct policy
objects.  But I think they are policy *uses*, not policy *definitions*
--- which is why is prefer to give them less prominent lifecycles.  In
the example cited above, one policy use object might be: {id: <some
int>, type: anti_collocation, properties: {level: rack}}, and there
are four references to it; another policy use object might be {id: <some
int>, type: network_reachability}, and there are three references to
it.  What object should own the policy use objects?  You might
answer that policy uses are owned by groups.  I do not think it makes
sense to give them a more prominent lifecycle.  As I said, my preference
would be to give them a less prominent lifecycle.  I would be happy
to see each policy use owned by an InstanceGroupPolicy[Use] that references
it and allow only one reference per policy use --- in other words, make
the InstanceGroupPolicy[Use] class inherit from the Policy Use class.  And
since I am not proposing that anything else inherit from the Policy Use
class, I would even more prefer to see its contents simply merged inline
into the InstanceGroupPolicy[Use] class.</font>
<br>
<br><font size=2 face="sans-serif">Regards,</font>
<br><font size=2 face="sans-serif">Mike</font>
<br>
<br>
<br>
<br><font size=1 color=#5f5f5f face="sans-serif">From:      
 </font><font size=1 face="sans-serif">"Yathiraj Udupi
(yudupi)" <yudupi@cisco.com></font>
<br><font size=1 color=#5f5f5f face="sans-serif">To:      
 </font><font size=1 face="sans-serif">Mike Spreitzer/Watson/IBM@IBMUS,
</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Cc:      
 </font><font size=1 face="sans-serif">OpenStack Development
Mailing List <openstack-dev@lists.openstack.org></font>
<br><font size=1 color=#5f5f5f face="sans-serif">Date:      
 </font><font size=1 face="sans-serif">10/14/2013 01:38 PM</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Subject:    
   </font><font size=1 face="sans-serif">Re: [scheduler]
Policy Model</font>
<br>
<hr noshade>
<br>
<br>
<br><font size=2 face="Calibri">Mike, </font>
<br>
<br><font size=2 face="Calibri">Like I proposed in my previous email about
the model and the APIs, </font>
<br>
<br><font size=2 face="Calibri">About the InstanceGroupPolicy, why not
leave it as is, and introduce a new abstract model class called Policy.
 </font>
<br><font size=2 face="Calibri">The InstanceGroupPolicy will be a reference
to a Policy object saved separately. </font>
<br><font size=2 face="Calibri">and the "policy" field will point
to the saved Policy object's unique name or id. </font>
<br>
<br><font size=2 face="Calibri">The new class Policy – can have the usual
fields – id, name, uuid, and a dictionary of key-value pairs for any additional
arguments about the policy. </font>
<br>
<br><font size=2 face="Calibri">This is in alignment with the model for
InstanceGroupMember, which is a reference to an actual Instance Object
saved in the DB. </font>
<br>
<br><font size=2 face="Calibri">I will color all the diamonds black to
make it a composition I the UML diagram. </font>
<br>
<br><font size=2 face="Calibri">Thanks,</font>
<br><font size=2 face="Calibri">Yathi. </font>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br><font size=2 face="Calibri"><b>From: </b>Mike Spreitzer <</font><a href=mailto:mspreitz@us.ibm.com><font size=2 color=blue face="Calibri"><u>mspreitz@us.ibm.com</u></font></a><font size=2 face="Calibri">><b><br>
Date: </b>Monday, October 14, 2013 7:14 AM<b><br>
To: </b>Yathiraj Udupi <</font><a href=mailto:yudupi@cisco.com><font size=2 color=blue face="Calibri"><u>yudupi@cisco.com</u></font></a><font size=2 face="Calibri">><b><br>
Cc: </b>OpenStack Development Mailing List <</font><a href="mailto:openstack-dev@lists.openstack.org"><font size=2 color=blue face="Calibri"><u>openstack-dev@lists.openstack.org</u></font></a><font size=2 face="Calibri">><b><br>
Subject: </b>[scheduler] Policy Model</font>
<br>
<br><font size=2 face="sans-serif">Could we agree on the following small
changes to the model you posted last week?</font><font size=2 face="Calibri"><br>
</font><font size=2 face="sans-serif"><br>
1.  Rename InstanceGroupPolicy to InstanceGroupPolicyUse</font><font size=2 face="Calibri"><br>
</font><font size=2 face="sans-serif"><br>
2.  In InstanceGroupPolicy[Use], rename the "policy" field
to "policy_type"</font><font size=2 face="Calibri"><br>
</font><font size=2 face="sans-serif"><br>
3.  Add an InstanceGroupPolicyUseProperty table, holding key/value
pairs (two strings) giving the properties of the policy uses</font><font size=2 face="Calibri"><br>
</font><font size=2 face="sans-serif"><br>
4.  Color all the diamonds black</font><font size=2 face="Calibri">
<br>
</font><font size=2 face="sans-serif"><br>
Thanks,</font><font size=2 face="Calibri"> </font><font size=2 face="sans-serif"><br>
Mike</font>
<br>