<?xml version="1.0" encoding="UTF-8" standalone="yes"?><oembed><version><![CDATA[1.0]]></version><provider_name><![CDATA[CloudForms Now]]></provider_name><provider_url><![CDATA[http://cloudformsblog.redhat.com]]></provider_url><author_name><![CDATA[johnhardy36]]></author_name><author_url><![CDATA[https://cloudformsblog.redhat.com/author/johnhardy36/]]></author_url><title><![CDATA[AWS &#8211; Elastic Load Balancers and&nbsp;Cloudforms]]></title><type><![CDATA[link]]></type><html><![CDATA[<p>First entry in ages, but those who know me will have seen I have been visiting a few places around the globe. Anyway, I promised some time ago the ability to add Amazon EC2 Instances to Amazon Elastic Load Balancers, here it is.</p>
<p>Problem was that whilst I have spent a couple of hours here and there on airplanes recently, its still quite difficult to connect to AWS from them! So any work on this had to wait until airport lounges. Its done now so here is the entry for it.<!--more--></p>
<p>We start with the design, I wanted to deliver this as something that could be re-used and eat my own dog food when it comes to state-machines. Also because a load balancer best works with more than one workload the result of this was always going to include a n-tier service of instances. The following diagram show the high level design to the service.</p>
<p><a href="http://cloudformsnow.files.wordpress.com/2014/03/slide1.jpg"><img data-attachment-id="245" data-permalink="https://cloudformsblog.redhat.com/slide1/" data-orig-file="https://cloudformsredhat.files.wordpress.com/2014/03/slide1.jpg?w=539&#038;h=338" data-orig-size="539,338" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;1&quot;}" data-image-title="Slide1" data-image-description="" data-medium-file="https://cloudformsredhat.files.wordpress.com/2014/03/slide1.jpg?w=539&#038;h=338?w=300" data-large-file="https://cloudformsredhat.files.wordpress.com/2014/03/slide1.jpg?w=539&#038;h=338?w=539" class="aligncenter wp-image-245 size-full" src="https://cloudformsredhat.files.wordpress.com/2014/03/slide1.jpg?w=539&#038;h=338" alt="Slide1" width="539" height="338" srcset="https://cloudformsredhat.files.wordpress.com/2014/03/slide1.jpg 539w, https://cloudformsredhat.files.wordpress.com/2014/03/slide1.jpg?w=150&amp;h=94 150w, https://cloudformsredhat.files.wordpress.com/2014/03/slide1.jpg?w=300&amp;h=188 300w" sizes="(max-width: 539px) 100vw, 539px" /></a></p>
<p>It is a service bundle that consists of two service items, each service item has some sort of service resource to it. The next diagram shows the actual service I am delivering in context to the first diagram.</p>
<p><a href="http://cloudformsnow.files.wordpress.com/2014/03/slide2.jpg"><img data-attachment-id="246" data-permalink="https://cloudformsblog.redhat.com/slide2/" data-orig-file="https://cloudformsredhat.files.wordpress.com/2014/03/slide2.jpg?w=679&#038;h=334" data-orig-size="679,334" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;1&quot;}" data-image-title="Slide2" data-image-description="" data-medium-file="https://cloudformsredhat.files.wordpress.com/2014/03/slide2.jpg?w=679&#038;h=334?w=300" data-large-file="https://cloudformsredhat.files.wordpress.com/2014/03/slide2.jpg?w=679&#038;h=334?w=679" class="aligncenter wp-image-246 size-full" src="https://cloudformsredhat.files.wordpress.com/2014/03/slide2.jpg?w=679&#038;h=334" alt="Slide2" width="679" height="334" srcset="https://cloudformsredhat.files.wordpress.com/2014/03/slide2.jpg 679w, https://cloudformsredhat.files.wordpress.com/2014/03/slide2.jpg?w=150&amp;h=74 150w, https://cloudformsredhat.files.wordpress.com/2014/03/slide2.jpg?w=300&amp;h=148 300w" sizes="(max-width: 679px) 100vw, 679px" /></a></p>
<p>My service has a service bundle called “N-Tier AWS”, that has two service items called “Web Servers” and “Load Balancer”. The “Web Servers” delivers two AWS EC2 instances named “Web Server 1” and “Web Server 2”. There is nothing special about “Web Servers”, it’s a standard service item of AWS EC2 resources (AMI’s). The second service item is the new one I am blogging about. This is a generic item that connects to its own State Machine through a relationship connection. For this I had to edit the class of the out of the box state machine. Why? Because I wanted to nest my StateMachine with that of the out of the box one. Here is the change I made;</p>
<p><strong>Edited /Factory / StateMachines / ServiceProvision_Template /</strong></p>
<p>And added to the top of this class the following Field</p>
<ul>
<li>Field Name – rel1</li>
<li>Field Type – Relationship</li>
</ul>
<p>Accept all other defaults for the field.</p>
<p>It should look something like;</p>
<p><a href="http://cloudformsnow.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-15-15-43.png"><img data-attachment-id="263" data-permalink="https://cloudformsblog.redhat.com/screen-shot-2014-03-04-at-15-15-43/" data-orig-file="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-15-15-43.png" data-orig-size="1930,1006" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Screen Shot 2014-03-04 at 15.15.43" data-image-description="" data-medium-file="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-15-15-43.png?w=300" data-large-file="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-15-15-43.png?w=1024" class="alignnone wp-image-263 size-large" src="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-15-15-43.png?w=1024&#038;h=534" alt="Screen Shot 2014-03-04 at 15.15.43" srcset="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-15-15-43.png?w=1024&amp;h=534 1024w, https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-15-15-43.png?w=150&amp;h=78 150w, https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-15-15-43.png?w=300&amp;h=156 300w, https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-15-15-43.png?w=768&amp;h=400 768w, https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-15-15-43.png 1930w" sizes="(max-width: 1024px) 100vw, 1024px"   /></a></p>
<p><span style="line-height:1.5em;">With the class change made, we can write into this relationship the call to the new statemachine. This means when ever you want to add the capability of AWS EC2 load balancers, all you need to do is wire the statemachine for loadbalancers to your service bundle state machine.</span></p>
<p>The state machine which is the download-able part of this, looks something like; Its simplicity is its power! If the state machine errors then we shall execute an error method called error_nlb otherwise, on entry to the state machine we shall run a method called add_to_nlb.</p>
<p><a href="http://cloudformsnow.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-15-33-09.png"><img data-attachment-id="266" data-permalink="https://cloudformsblog.redhat.com/screen-shot-2014-03-04-at-15-33-09/" data-orig-file="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-15-33-09.png" data-orig-size="2330,152" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Screen Shot 2014-03-04 at 15.33.09" data-image-description="" data-medium-file="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-15-33-09.png?w=300" data-large-file="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-15-33-09.png?w=1024" class="alignnone wp-image-266 size-large" src="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-15-33-09.png?w=1024&#038;h=67" alt="Screen Shot 2014-03-04 at 15.33.09" srcset="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-15-33-09.png?w=1024&amp;h=67 1024w, https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-15-33-09.png?w=2048&amp;h=134 2048w, https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-15-33-09.png?w=150&amp;h=10 150w, https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-15-33-09.png?w=300&amp;h=20 300w, https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-15-33-09.png?w=768&amp;h=50 768w" sizes="(max-width: 1024px) 100vw, 1024px"   /></a></p>
<p>Download the state machine here -: <a title="https://github.com/jonnyfiveiq/CloudFORMSNOW/blob/master/Integrations/Provisioning/AWS_ELB/cfnow-aws-elb.xml" href="https://github.com/jonnyfiveiq/CloudFORMSNOW/blob/master/Integrations/Provisioning/AWS_ELB/cfnow-aws-elb.xml" target="_blank" rel="noopener">https://github.com/jonnyfiveiq/CloudFORMSNOW/blob/master/Integrations/Provisioning/AWS_ELB/cfnow-aws-elb.xml</a></p>
<p>This will create a new namespace and class as follows;</p>
<p><a href="http://cloudformsnow.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-16-09-57.png"><img data-attachment-id="269" data-permalink="https://cloudformsblog.redhat.com/screen-shot-2014-03-04-at-16-09-57/" data-orig-file="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-16-09-57.png?w=814&#038;h=132" data-orig-size="814,132" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Screen Shot 2014-03-04 at 16.09.57" data-image-description="" data-medium-file="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-16-09-57.png?w=814&#038;h=132?w=300" data-large-file="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-16-09-57.png?w=814&#038;h=132?w=814" class="alignnone wp-image-269 size-full" src="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-16-09-57.png?w=814&#038;h=132" alt="Screen Shot 2014-03-04 at 16.09.57" width="814" height="132" srcset="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-16-09-57.png 814w, https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-16-09-57.png?w=150&amp;h=24 150w, https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-16-09-57.png?w=300&amp;h=49 300w, https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-16-09-57.png?w=768&amp;h=125 768w" sizes="(max-width: 814px) 100vw, 814px" /></a></p>
<p>You are then free to wire in my state machine to your service state machine, looking something like;</p>
<p><a href="http://cloudformsnow.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-16-11-49.png"><img data-attachment-id="270" data-permalink="https://cloudformsblog.redhat.com/screen-shot-2014-03-04-at-16-11-49/" data-orig-file="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-16-11-49.png" data-orig-size="2158,1216" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Screen Shot 2014-03-04 at 16.11.49" data-image-description="" data-medium-file="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-16-11-49.png?w=300" data-large-file="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-16-11-49.png?w=1024" class="alignnone wp-image-270 size-large" src="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-16-11-49.png?w=1024&#038;h=578" alt="Screen Shot 2014-03-04 at 16.11.49" srcset="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-16-11-49.png?w=1024&amp;h=578 1024w, https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-16-11-49.png?w=2048&amp;h=1154 2048w, https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-16-11-49.png?w=150&amp;h=85 150w, https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-16-11-49.png?w=300&amp;h=169 300w, https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-16-11-49.png?w=768&amp;h=433 768w" sizes="(max-width: 1024px) 100vw, 1024px"   /></a></p>
<p>The service bundle is constructed with what ever instances you was instances are, in my case web server_a and web server_b , then a 3rd service item being the loadbalancer state machine, so this is a generic service item. Here is a screen shot of my bundle resources!</p>
<p><a href="http://cloudformsnow.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-16-12-49.png"><img data-attachment-id="272" data-permalink="https://cloudformsblog.redhat.com/screen-shot-2014-03-04-at-16-12-49/" data-orig-file="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-16-12-49.png" data-orig-size="2296,392" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Screen Shot 2014-03-04 at 16.12.49" data-image-description="" data-medium-file="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-16-12-49.png?w=300" data-large-file="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-16-12-49.png?w=1024" class="alignnone wp-image-272 size-large" src="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-16-12-49.png?w=1024&#038;h=174" alt="Screen Shot 2014-03-04 at 16.12.49" srcset="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-16-12-49.png?w=1019&amp;h=174 1019w, https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-16-12-49.png?w=2038&amp;h=348 2038w, https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-16-12-49.png?w=150&amp;h=26 150w, https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-16-12-49.png?w=300&amp;h=51 300w, https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-16-12-49.png?w=768&amp;h=131 768w, https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-16-12-49.png?w=1024&amp;h=175 1024w" sizes="(max-width: 1024px) 100vw, 1024px"   /></a></p>
<p>There service bundle detail is as follows, remember to create your own new state machine for the bundle and not just use default! In summary the state machine that this bundle points to does nothing at all other that what is configured in default!</p>
<p><a href="http://cloudformsnow.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-16-12-41.png"><img data-attachment-id="271" data-permalink="https://cloudformsblog.redhat.com/screen-shot-2014-03-04-at-16-12-41/" data-orig-file="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-16-12-41.png" data-orig-size="1106,578" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Screen Shot 2014-03-04 at 16.12.41" data-image-description="" data-medium-file="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-16-12-41.png?w=300" data-large-file="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-16-12-41.png?w=1024" class="alignnone wp-image-271 size-large" src="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-16-12-41.png?w=1024&#038;h=534" alt="Screen Shot 2014-03-04 at 16.12.41" srcset="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-16-12-41.png?w=1022&amp;h=534 1022w, https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-16-12-41.png?w=150&amp;h=78 150w, https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-16-12-41.png?w=300&amp;h=157 300w, https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-16-12-41.png?w=768&amp;h=401 768w, https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-16-12-41.png 1106w" sizes="(max-width: 1024px) 100vw, 1024px"   /></a></p>
<p>And finally the generic item that is &#8220;AWS Load Balancer&#8221; and resides in automation location &#8220;/Factory/StateMachines/ServiceProvision_Template/aws_loadbalancers&#8221; is the state machine you will import from GitHub url on this page, here is the generic service item detail;</p>
<p><a href="http://cloudformsnow.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-16-13-02.png"><img data-attachment-id="273" data-permalink="https://cloudformsblog.redhat.com/screen-shot-2014-03-04-at-16-13-02/" data-orig-file="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-16-13-02.png" data-orig-size="1110,546" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Screen Shot 2014-03-04 at 16.13.02" data-image-description="" data-medium-file="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-16-13-02.png?w=300" data-large-file="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-16-13-02.png?w=1024" class="alignnone wp-image-273 size-large" src="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-16-13-02.png?w=1024&#038;h=504" alt="Screen Shot 2014-03-04 at 16.13.02" srcset="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-16-13-02.png?w=1024&amp;h=504 1024w, https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-16-13-02.png?w=150&amp;h=74 150w, https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-16-13-02.png?w=300&amp;h=148 300w, https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-16-13-02.png?w=768&amp;h=378 768w, https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-16-13-02.png 1110w" sizes="(max-width: 1024px) 100vw, 1024px"   /></a></p>
<p>Notice no dialog, just the state machine to be called.</p>
<p><b>The Loadbalancer StateMachine</b></p>
<p>Some design considerations needed to be taken into account, for example when the instances first spin up will not immediately have IP addresses, the status checks will not be complete, as show here;</p>
<p><a href="http://cloudformsnow.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-17-33-52.png"><img data-attachment-id="261" data-permalink="https://cloudformsblog.redhat.com/screen-shot-2014-02-28-at-17-33-52/" data-orig-file="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-17-33-52.png" data-orig-size="1750,116" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Screen Shot 2014-02-28 at 17.33.52" data-image-description="" data-medium-file="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-17-33-52.png?w=300" data-large-file="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-17-33-52.png?w=1024" class="aligncenter wp-image-261 size-large" src="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-17-33-52.png?w=1024&#038;h=67" alt="Screen Shot 2014-02-28 at 17.33.52" srcset="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-17-33-52.png?w=1011&amp;h=67 1011w, https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-17-33-52.png?w=150&amp;h=10 150w, https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-17-33-52.png?w=300&amp;h=20 300w, https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-17-33-52.png?w=768&amp;h=51 768w, https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-17-33-52.png?w=1024&amp;h=68 1024w, https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-17-33-52.png 1750w" sizes="(max-width: 1024px) 100vw, 1024px"   /></a></p>
<p>So we need to wait for the instances to be come available, the best way for this is to allow Cloudforms to tell the statemachine when an IP address turns up for each service resource in the service bundle. Now we can not actually have the message come to us, so we use the statemachine re-entrancy concept. Sounds complicated by easy to explain. We simply launch our loadbalncer statemachine at the same time as the AWS EC2 Instance statemachine. On initial run of the load balancer statemachine we check to the service resources for ip addresses, if blank we then put the load balancer statemachine into retry mode, with an interval of 30 seconds. The AWS EC2 instance statemachine will continue to process the service resources and insatiate the instances, 30 seconds later our loadbalancer statamachine will re-enter and run again. Repeating the same initial tests, if the instances now have IP addresses then the instances will be added to a load balancer, if the instances are still without IP addresses as with the first run, the loadbalancer statemachine will go into retry mode again.</p>
<p>The other features of the statamachine are to read what the user selected when ordering the service bundle. There are three parameters, shown here in the graphic;</p>
<p><a href="http://cloudformsnow.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-16-55-59.png"><img data-attachment-id="258" data-permalink="https://cloudformsblog.redhat.com/screen-shot-2014-02-28-at-16-55-59/" data-orig-file="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-16-55-59.png" data-orig-size="2296,456" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Screen Shot 2014-02-28 at 16.55.59" data-image-description="" data-medium-file="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-16-55-59.png?w=300" data-large-file="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-16-55-59.png?w=1024" class="alignnone wp-image-258 size-large" src="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-16-55-59.png?w=1024&#038;h=203" alt="Screen Shot 2014-02-28 at 16.55.59" srcset="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-16-55-59.png?w=1024&amp;h=203 1024w, https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-16-55-59.png?w=2044&amp;h=406 2044w, https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-16-55-59.png?w=150&amp;h=30 150w, https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-16-55-59.png?w=300&amp;h=60 300w, https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-16-55-59.png?w=768&amp;h=153 768w" sizes="(max-width: 1024px) 100vw, 1024px"   /></a></p>
<p>The 3 elements we need are;</p>
<ul>
<li>Elastic Load Balancer – Check Box</li>
<li>Elastic Load Balancer Name – Text Box</li>
<li>Existing Elastic Load Balancer – Dynamic Drop Down</li>
</ul>
<p>The user must first select “Elastic Load Balancer – Check Box “ to enable our loadbalancer statemachine. Once this is enabled the user can choose either “Elastic Load Balancer Name – Text Box” to create a NEW elastic load balancer or select from the “Existing Elastic Load Balancer – Dynamic Drop Down” an existing Elastic Load Balancer. The dynamic drop down has behind it a method to populate the drop down with load balancers from a specified AWS account.</p>
<h2><strong>StateMachine Method Walk-Through</strong></h2>
<p>First we start with my bad habit of  “We are here” really loudly! Actually when I first wrote this method, I pumped my log entries to a completely new log file. It made it easy to debug whilst two statemachine are running synconlosy one of them delivering 2 instances or more, it can be tricky to read the automate log file real time.</p>
<p>As part of the starting code we have the gem statement, we are using the out of the box ruby gem for AWS-SDK, this is an awesome gem providing huge amounts of functions covering both S3 and EC2.</p>
<pre class="brush: ruby; title: ; notranslate" title="">&lt;/pre&gt;
require 'aws-sdk'

$evm.log(&quot;info&quot;, &quot;------------------------------ADD TO AWS LOAD BALANCER------------------------------n&quot;)

</pre>
<p>Next we have a section of code that deals with setting up the objects;</p>
<pre class="brush: ruby; title: ; notranslate" title="">&lt;/pre&gt;
stp_task = $evm.root[&quot;service_template_provision_task&quot;]

miq_request_id = $evm.vmdb('miq_request_task', stp_task.get_option(:parent_task_id))

dialogOptions = miq_request_id.get_option(:dialog)

$evm.log(&quot;info&quot;, &quot;ELB New ELB Name --&gt; #{dialogOptions['dialog_elbName)']}n&quot;)

$evm.log(&quot;info&quot;, &quot;ELB Existing ELB --&gt; #{dialogOptions['dialog_existingELB']}n&quot;)

$evm.log(&quot;info&quot;, &quot;Add to ELB Enabled --&gt; #{dialogOptions['dialog_elb']}n&quot;)

miqr = $evm.vmdb('service', stp_task.get_option(:parent_service_id))

</pre>
<p>Line 1, “stp_task”, is fetching the service_template_provision_task from the current statemachine. This would result in the service_template_provision_task for loadbalancers, which is not very useful to us by itself because its not the loadbalancers that have the detail about what is going to be insatiated, but the other service in the service bundle. Also the loadbalancer service did not collect the user input either that was the bundled server so Line 2, “miq_request_id” fetches from the VMDB the bundle service instance, the subsequent lines then extract from the bundle service the dialog options that were set. Lastly we fetch the live service instance for the bundle, this holds a very special helper attribute that will be populated by cloudforms as new VM’s are provisioned called “VMS”, at start its value is nil, but as instances are provisioned their object references are placed into an array in this attribute.</p>
<pre class="brush: ruby; title: ; notranslate" title="">&lt;/pre&gt;
i = 0

unless miqr.vms.nil?

miqr.vms.each do |vm|

i = i.to_i + 1

$evm.log(&quot;info&quot;, &quot;------------ VM #{i} ----------n&quot;)

$evm.log(&quot;info&quot;, &quot;Instance Name --&gt; #{vm.name}n&quot;)

$evm.log(&quot;info&quot;, &quot;Instnace ID --&gt; #{vm.ems_ref}n&quot;)

$evm.log(&quot;info&quot;, &quot;DNS Name --&gt; #{vm.location}n&quot;)

$evm.log(&quot;info&quot;, &quot;PowerState --&gt; #{vm.power_state}n&quot;)

$evm.log(&quot;info&quot;, &quot;Active --&gt; #{vm.active}n&quot;)

instanceA &lt;&lt; {:instance_id =&gt; vm.ems_ref}

$evm.log(&quot;info&quot;, &quot;------------ VM #{i} ----------n&quot;)

end

end

</pre>
<p>This code is fairly simple,  mainly logging so I can see the instances as they turn up, but most importantly its adding them to a new Ruby hash called instance as they turn up. Here is the segment that reports the number of instances (VMs) in the miqr objects (Service Request) vs that of the provisioned instances (isntanceCount)</p>
<pre class="brush: ruby; title: ; notranslate" title="">&lt;/pre&gt;
vmCount = miqr.vms.count

instanceCount = instanceA.size

$evm.log(&quot;info&quot;, &quot;VMs Count --&gt; #{vmCount}n&quot;)

$evm.log(&quot;info&quot;, &quot;instanceA Count --&gt; #{instanceCount}n&quot;)

</pre>
<p>Now we start the if block, to simply understand &#8220;did the user enable ELB?&#8221; and if they did, &#8220;did they want a new one or use an existing ELB&#8221;?</p>
<p>First if is &#8220;Have we the same number of instances as requested instances live and running?</p>
<pre class="brush: ruby; title: ; notranslate" title="">&lt;/span&gt;

if vmCount &gt; 0 &amp;&amp; vmCount = instanceCount

if dialogOptions['dialog_elb'].to_s == &quot;1&quot;

</pre>
<p>Now we deal with new vs old ELB,</p>
<pre class="brush: ruby; title: ; notranslate" title="">

if dialogOptions['dialog_existingELB'] != &quot; None&quot;
 $evm.log(&quot;info&quot;, &quot;Using Existing ELB #{dialogOptions['dialog_existingELB']}n&quot;)
 elbName = dialogOptions['dialog_existingELB']
 elsif dialogOptions['dialog_elbName'] != &quot;&quot;
 $evm.log(&quot;info&quot;, &quot;Creating NEW ELB #{dialogOptions['dialog_elbName']}n&quot;)
 elbName = dialogOptions['dialog_elbName']

#create the ELB

else
 $evm.log(&quot;info&quot;, &quot;Neither New ELB or Existing ELB was set!n&quot;)
 end

</pre>
<p>and finally the bit that actually adds the instances to the ELB.</p>
<pre class="brush: ruby; title: ; notranslate" title="">

$evm.log(&quot;info&quot;, &quot;Using ELB #{elbName}n&quot;)
 AWS.config(:access_key_id =&gt; '&lt;your_user&gt;', :secret_access_key =&gt; '&lt;your_key&gt;')

ec2 = AWS::EC2.new
 elb = AWS::ELB.new

miqr.vms.each do |vm|
 $evm.log(&quot;info&quot;, &quot;Adding #{vm.ems_ref} to ELB #{elbName}n&quot;)
 i = ec2.instances[&quot;#{vm.ems_ref}&quot;]
 elb.load_balancers[&quot;#{elbName}&quot;].instances.register(i)
 end
 end

</pre>
<p>I do admit I took a short cut in hardcoding the authentication details in the method, you should do better and get these from the provider!</p>
<p>Now here is the part of the method thats actually more important than adding the instances to the ELB! The re-entrancy part of the method.</p>
<pre class="brush: ruby; title: ; notranslate" title="">

else
 passNo = stp_task.get_option(:pass)
 passNo = passNo.to_i + 1
 stp_task.set_option(:pass, &quot;#{passNo}&quot;)
 $evm.log(&quot;info&quot;, &quot;Pass Number #{passNo}n&quot;)
 $evm.root['ae_result'] = 'retry'
 $evm.root['ae_retry_interval'] = '30.seconds'
 $evm.log(&quot;info&quot;, &quot;-------------------RETRY-----------------------n&quot;)

exit MIQ_OK
end

</pre>
<p>Notice that in the block, we have check previously should we be here, else do this. Then we set the &#8220;ae_result&#8221; to retry and &#8220;ae_retry_interval&#8221; to every 30 seconds. This means that when we exit this method state, the state machine will put this into retry 30 seconds later, and we do the whole method again and again until we pass the check of should we be here or not, and add the instances to the ELB.</p>
<p>User Experience</p>
<p>Here is what the consumers or users would see when ordering an item in Cloudforms with ELB supports.</p>
<p>1. Select the item from the catalog</p>
<p><a href="http://cloudformsnow.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-16-55-23.png"><img data-attachment-id="256" data-permalink="https://cloudformsblog.redhat.com/screen-shot-2014-02-28-at-16-55-23/" data-orig-file="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-16-55-23.png" data-orig-size="2320,522" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Screen Shot 2014-02-28 at 16.55.23" data-image-description="" data-medium-file="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-16-55-23.png?w=300" data-large-file="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-16-55-23.png?w=1024" class="alignnone wp-image-256 size-large" src="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-16-55-23.png?w=1024&#038;h=230" alt="Screen Shot 2014-02-28 at 16.55.23" srcset="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-16-55-23.png?w=1024&amp;h=230 1024w, https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-16-55-23.png?w=2044&amp;h=460 2044w, https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-16-55-23.png?w=150&amp;h=34 150w, https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-16-55-23.png?w=300&amp;h=68 300w, https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-16-55-23.png?w=768&amp;h=173 768w" sizes="(max-width: 1024px) 100vw, 1024px"   /></a></p>
<p>2. Complete the dialog for the catalog item, selecting the ELB configuration. (ignore the other detail to this dialog &#8211; that may form part two of this demo!)</p>
<p><a href="http://cloudformsnow.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-16-55-38.png"><img data-attachment-id="257" data-permalink="https://cloudformsblog.redhat.com/screen-shot-2014-02-28-at-16-55-38/" data-orig-file="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-16-55-38.png" data-orig-size="2290,966" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Screen Shot 2014-02-28 at 16.55.38" data-image-description="" data-medium-file="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-16-55-38.png?w=300" data-large-file="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-16-55-38.png?w=1024" class="alignnone wp-image-257 size-large" src="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-16-55-38.png?w=1024&#038;h=432" alt="Screen Shot 2014-02-28 at 16.55.38" srcset="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-16-55-38.png?w=1024&amp;h=432 1024w, https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-16-55-38.png?w=2048&amp;h=864 2048w, https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-16-55-38.png?w=150&amp;h=63 150w, https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-16-55-38.png?w=300&amp;h=127 300w, https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-16-55-38.png?w=768&amp;h=324 768w" sizes="(max-width: 1024px) 100vw, 1024px"   /></a></p>
<p>3. Request enters queue.</p>
<p><a href="http://cloudformsnow.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-16-58-19.png"><img data-attachment-id="260" data-permalink="https://cloudformsblog.redhat.com/screen-shot-2014-02-28-at-16-58-19/" data-orig-file="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-16-58-19.png" data-orig-size="3212,196" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Screen Shot 2014-02-28 at 16.58.19" data-image-description="" data-medium-file="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-16-58-19.png?w=300" data-large-file="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-16-58-19.png?w=1024" class="alignnone wp-image-260 size-large" src="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-16-58-19.png?w=1024&#038;h=62" alt="Screen Shot 2014-02-28 at 16.58.19" srcset="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-16-58-19.png?w=1024&amp;h=62 1024w, https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-16-58-19.png?w=2032&amp;h=124 2032w, https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-16-58-19.png?w=150&amp;h=9 150w, https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-16-58-19.png?w=300&amp;h=18 300w, https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-16-58-19.png?w=768&amp;h=47 768w" sizes="(max-width: 1024px) 100vw, 1024px"   /></a></p>
<p>Now if we have a look at AWS, (Not that we need to as we have Cloudforms!!!) The ELB&#8217;s during provisioning look empty;</p>
<p><a href="http://cloudformsnow.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-16-57-11.png"><img data-attachment-id="259" data-permalink="https://cloudformsblog.redhat.com/screen-shot-2014-02-28-at-16-57-11/" data-orig-file="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-16-57-11.png" data-orig-size="2928,1258" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Screen Shot 2014-02-28 at 16.57.11" data-image-description="" data-medium-file="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-16-57-11.png?w=300" data-large-file="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-16-57-11.png?w=1024" class="alignnone wp-image-259 size-large" src="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-16-57-11.png?w=1024&#038;h=440" alt="Screen Shot 2014-02-28 at 16.57.11" srcset="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-16-57-11.png?w=1024&amp;h=440 1024w, https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-16-57-11.png?w=2048&amp;h=880 2048w, https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-16-57-11.png?w=150&amp;h=64 150w, https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-16-57-11.png?w=300&amp;h=129 300w, https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-02-28-at-16-57-11.png?w=768&amp;h=330 768w" sizes="(max-width: 1024px) 100vw, 1024px"   /></a></p>
<p>And when Cloudforms has finished provisioning the instances, and added them to the ELB, AWS lists them as so;</p>
<p><a href="http://cloudformsnow.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-15-29-30.png"><img data-attachment-id="264" data-permalink="https://cloudformsblog.redhat.com/screen-shot-2014-03-04-at-15-29-30/" data-orig-file="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-15-29-30.png" data-orig-size="2916,1414" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Screen Shot 2014-03-04 at 15.29.30" data-image-description="" data-medium-file="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-15-29-30.png?w=300" data-large-file="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-15-29-30.png?w=1024" class="alignnone wp-image-264 size-large" src="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-15-29-30.png?w=1024&#038;h=496" alt="Screen Shot 2014-03-04 at 15.29.30" srcset="https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-15-29-30.png?w=1024&amp;h=496 1024w, https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-15-29-30.png?w=2046&amp;h=992 2046w, https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-15-29-30.png?w=150&amp;h=73 150w, https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-15-29-30.png?w=300&amp;h=145 300w, https://cloudformsredhat.files.wordpress.com/2014/03/screen-shot-2014-03-04-at-15-29-30.png?w=768&amp;h=372 768w" sizes="(max-width: 1024px) 100vw, 1024px"   /></a></p>
<p>This concludes this post, I hope its of value! Remember that the design goal here was to create a state machine that could be easily hooked to any AWS based service to provide ELB support.</p>
]]></html><thumbnail_url><![CDATA[https://cloudformsredhat.files.wordpress.com/2014/03/slide1.jpg?fit=440%2C330]]></thumbnail_url><thumbnail_width><![CDATA[440]]></thumbnail_width><thumbnail_height><![CDATA[276]]></thumbnail_height></oembed>