<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Nov 18, 2013 at 5:57 AM, Zane Bitter <span dir="ltr"><<a href="mailto:zbitter@redhat.com" target="_blank">zbitter@redhat.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class=""><div class="h5">On 16/11/13 11:15, Angus Salkeld wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
On 15/11/13 08:46 -0600, Christopher Armstrong wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
On Fri, Nov 15, 2013 at 3:57 AM, Zane Bitter <<a href="mailto:zbitter@redhat.com" target="_blank">zbitter@redhat.com</a>> wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
On 15/11/13 02:48, Christopher Armstrong wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
On Thu, Nov 14, 2013 at 5:40 PM, Angus Salkeld <<a href="mailto:asalkeld@redhat.com" target="_blank">asalkeld@redhat.com</a><br>
<mailto:<a href="mailto:asalkeld@redhat.com" target="_blank">asalkeld@redhat.com</a>>> wrote:<br>
<br>
    On 14/11/13 10:19 -0600, Christopher Armstrong wrote:<br>
<br>
        <a href="http://docs.heatautoscale." target="_blank">http://docs.heatautoscale.</a>__<a href="http://apiary.io/" target="_blank">ap<u></u>iary.io/</a><br>
<br>
        <<a href="http://docs.heatautoscale.apiary.io/" target="_blank">http://docs.heatautoscale.<u></u>apiary.io/</a>><br>
<br>
        I've thrown together a rough sketch of the proposed API for<br>
        autoscaling.<br>
        It's written in API-Blueprint format (which is a simple subset<br>
        of Markdown)<br>
        and provides schemas for inputs and outputs using JSON-Schema.<br>
        The source<br>
        document is currently at<br>
        <a href="https://github.com/radix/heat/__raw/as-api-spike/" target="_blank">https://github.com/radix/heat/<u></u>__raw/as-api-spike/</a><br>
autoscaling.__apibp<br>
<br>
<br>
<<a href="https://github.com/radix/heat/raw/as-api-spike/autoscaling.apibp" target="_blank">https://github.com/radix/<u></u>heat/raw/as-api-spike/<u></u>autoscaling.apibp</a><br>
><br>
<br>
<br>
        Things we still need to figure out:<br>
<br>
        - how to scope projects/domains. put them in the URL? get them<br>
        from the<br>
        token?<br>
        - how webhooks are done (though this shouldn't affect the API<br>
        too much;<br>
        they're basically just opaque)<br>
<br>
        Please read and comment :)<br>
<br>
<br>
    Hi Chistopher<br>
<br>
    In the group create object you have 'resources'.<br>
    Can you explain what you expect in there? I thought we talked at<br>
    summit about have a unit of scaling as a nested stack.<br>
<br>
    The thinking here was:<br>
    - this makes the new config stuff easier to scale (config get<br>
applied<br>
    Â  per scaling stack)<br>
<br>
    - you can potentially place notification resources in the scaling<br>
    Â  stack (think marconi message resource - on-create it sends a<br>
    Â  message)<br>
<br>
    - no need for a launchconfig<br>
    - you can place a LoadbalancerMember resource in the scaling stack<br>
    Â  that triggers the loadbalancer to add/remove it from the lb.<br>
<br>
<br>
    I guess what I am saying is I'd expect an api to a nested stack.<br>
<br>
<br>
Well, what I'm thinking now is that instead of "resources" (a<br>
mapping of<br>
resources), just have "resource", which can be the template definition<br>
for a single resource. This would then allow the user to specify a<br>
Stack<br>
resource if they want to provide multiple resources. How does that<br>
sound?<br>
<br>
</blockquote>
<br>
My thought was this (digging into the implementation here a bit):<br>
<br>
- Basically, the autoscaling code works as it does now: creates a<br>
template<br>
containing OS::Nova::Server resources (changed from AWS::EC2::Instance),<br>
with the properties obtained from the LaunchConfig, and creates a<br>
stack in<br>
Heat.<br>
- LaunchConfig can now contain any properties you like (I'm not 100%<br>
sure<br>
about this one*).<br>
- The user optionally supplies a template. If the template is<br>
supplied, it<br>
is passed to Heat and set in the environment as the provider for the<br>
OS::Nova::Server resource.<br>
<br>
<br>
</blockquote>
I don't like the idea of binding to OS::Nova::Server specifically for<br>
autoscaling. I'd rather have the ability to scale *any* resource,<br>
including<br>
nested stacks or custom resources. It seems like jumping through hoops to<br>
</blockquote>
<br>
big +1 here, autoscaling should not even know what it is scaling, just<br>
some resource. solum might want to scale all sorts of non-server<br>
resources (and other users).<br>
</blockquote>
<br></div></div>
I'm surprised by the negative reaction to what I suggested, which is a completely standard use of provider templates. Allowing a user-defined stack of resources to stand in for an unrelated resource type is the entire point of providers. Everyone says that it's a great feature, but if you try to use it for something they call it a "hack". Strange.<br>
</blockquote><div><br></div><div>To clarify this position (which I already did in IRC), replacing one concrete resource with another that means something in a completely different domain is a hack -- say, replacing "server" with "group of related resources". However, replacing OS::Nova::Server with something which still does something very much like creating a server is reasonable -- e.g., using a different API like one for creating containers or using a different cloud provider's API.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
So, allow me to make a slight modification to my proposal:<br>
<br>
- The autoscaling service manages a template containing OS::Heat::ScaledResource resources. This is an imaginary resource type that is not backed by a plugin in Heat.<br>
- If no template is supplied by the user, the environment declares another resource plugin as the provider for OS::Heat::ScaledResource (by default it would be OS::Nova::Server, but this should probably be configurable by the deployer... so if you had a region full of Docker containers and no Nova servers, you could set it to OS::Docker::Container or something).<br>

- If a provider template is supplied by the user, it would be specified as the provider in the environment file.<br>
<br>
This, I hope, demonstrates that autoscaling needs no knowledge whatsoever about what it is scaling to use this approach.<br>
<br></blockquote><div><br></div><div>It'd be interesting to see some examples, I think. I'll provide some examples of my proposals, with the following caveats:</div><div><br></div><div>- I'm assuming a separation of launch configuration from scaling group, as you proposed -- I don't really have a problem with this.</div>
<div>- I'm also writing these examples with the plural "resources" parameter, which there has been some bikeshedding around - I believe the structure can be the same whether we go with singular, plural, or even whole-template-as-a-string.</div>
<div><br></div><div># trivial example: scaling a single server<br></div><div><br></div><div>POST /launch_configs</div><div><br></div><div>{</div><div>    "name": "my-launch-config",</div><div>    "resources": {</div>
<div>        "my-server": {</div><div>            "type": "OS::Nova::Server",</div><div>            "properties": {</div><div>                "image": "my-image",<br>
</div><div>                "flavor": "my-flavor", # etc...</div><div>            }</div><div>        }</div><div>    }</div><div>}</div><div><br></div><div>POST /groups</div><div><br></div><div>{</div>
<div>    "name": "group-name",</div><div>    "launch_config": "my-launch-config",</div><div>    "min_size": 0,</div><div>    "max_size": 0,</div><div>}</div><div>
<br></div><div>(and then, the user would continue on to create a policy that scales the group, etc)</div><div><br></div><div># complex example: scaling a server with an attached volume</div><div><br></div><div>POST /launch_configs<br>
</div><div><br></div><div>{</div><div>    "name": "my-launch-config",</div><div>    "resources": {</div><div><div>        "my-volume": {</div><div>            "type": "OS::Cinder::Volume",</div>
<div>            "properties": {</div><div>                # volume properties...</div><div>            }</div><div>        },</div><div>        "my-server": {</div><div>            "type": "OS::Nova::Server",</div>
<div>            "properties": {</div><div>                "image": "my-image",<br></div><div>                "flavor": "my-flavor", # etc...</div><div>            }</div>
</div><div>        },</div><div>        "my-volume-attachment": {</div><div>            "type": "OS::Cinder::VolumeAttachment",</div><div>            "properties": {</div><div>                "volume_id": {"get_resource": "my-volume"},</div>
<div>                "instance_uuid": {"get_resource": "my-server"},</div><div>                "mountpoint": "/mnt/volume"</div><div>            }</div><div>        }</div>
<div>    }</div><div>}</div><div><br></div><div>(and so on, creating the group and policies in the same way).</div><div><br></div><div><br></div><div>Can you please provide an example of your proposal for the same use cases? Please indicate how you'd specify the custom properties for each resource and how you specify the provider template in the API.<br clear="all">
<div><br></div>-- <br><div dir="ltr"><div>IRC: radix</div>Christopher Armstrong<div>Rackspace</div></div>
<br><br>
</div></div></div></div>