|
26 | 26 | <h1 class="pull-left" style="margin-top: 0px;">Applying policies</h1>
|
27 | 27 | <a class="btn btn-primary pull-right" href="http://prose.io/#alien4cloud/alien4cloud.github.io/edit/sources/documentation/2.1.0/orchestrators/yorc/policies.markdown"><i class="fa fa-pencil-square-o"></i> Edit (pull request)</a>
|
28 | 28 | </div>
|
29 |
| - <p>Both monitoring policies (HTTP/TCP) and Affinity/Anti-Affinity OpenStack ServerGroup placement policies are natively available with Yorc Server.</p> |
| 29 | + <p>Yorc provides natively the following policies:</p> |
| 30 | + |
| 31 | +<ul> |
| 32 | + <li>Monitoring policies (HTTP/TCP).</li> |
| 33 | + <li>Affinity/Anti-Affinity OpenStack ServerGroup placement policies.</li> |
| 34 | + <li>Round-robin and bin-packing Hosts Pool placement policies.</li> |
| 35 | +</ul> |
30 | 36 |
|
31 | 37 | <p>Let’s see how we can apply these on apps:</p>
|
32 | 38 |
|
33 | 39 | <ul>
|
34 | 40 | <li><a href="#applying-a-server-group-anti-affinity-placement-policy-on-openstack">Server Group Anti-affinity placement policy on OpenStack</a></li>
|
35 | 41 | <li><a href="#applying-tcp-monitoring-policy">TCP monitoring policy</a></li>
|
36 | 42 | <li><a href="#applying-http-monitoring-policy-on-a-web-application">HTTP monitoring policy</a></li>
|
| 43 | + <li><a href="#applying-hosts-pool-placement-policies">Round-robin and bin-packing Hosts pool placement policies</a></li> |
37 | 44 | </ul>
|
38 | 45 |
|
39 | 46 | <h2 id="applying-a-server-group-anti-affinity-placement-policy-on-openstack">Applying a Server Group Anti affinity placement policy on OpenStack</h2>
|
@@ -195,6 +202,57 @@ <h3 id="edit-application-topology-2">Edit application topology</h3>
|
195 | 202 |
|
196 | 203 | <p>The next step will be to fix this by a self-healing policy !</p>
|
197 | 204 |
|
| 205 | +<h2 id="applying-hosts-pool-placement-policies">Applying Hosts Pool Placement Policies</h2> |
| 206 | + |
| 207 | +<p>On a Hosts Pool location, you can provide hosts as Computes and specify if a host is shareable and so can be used by different applications or different Computes of the same application.</p> |
| 208 | + |
| 209 | +<p>Now, with placement policies applied on an application, you can define how to choose the good host candidate for your Compute.</p> |
| 210 | + |
| 211 | +<p>Two policies are available:</p> |
| 212 | + |
| 213 | +<ul> |
| 214 | + <li><strong>yorc.policies.hostspool.BinPackingPlacement</strong></li> |
| 215 | + <li><strong>yorc.policies.hostspool.RoundRobinPlacement</strong></li> |
| 216 | +</ul> |
| 217 | + |
| 218 | +<p><strong>BinPackingPlacement</strong> is the default policy if nothing is specified: It means the host with already the most related allocations will be elect preferentially.</p> |
| 219 | + |
| 220 | +<p>On the contrary, the <strong>round-robin placement</strong> policy allows to choose preferentially the host with the least related allocations.</p> |
| 221 | + |
| 222 | +<h3 id="configure-location-policies-3">Configure location policies</h3> |
| 223 | + |
| 224 | +<p>After configuring your HostsPool location as described previously click on the <img src="../../../../images/2.1.0/yorc/policies-button.png" alt="policies button" height="26px" class="inline" /> button, select <strong>Catalog</strong> and use the search to find <strong>policies.hostspool</strong> as below.</p> |
| 225 | + |
| 226 | +<p><img src="../../../../images/2.1.0/yorc/search-hostspool-policy.png" alt="Search hosts pool policies" /></p> |
| 227 | + |
| 228 | +<p>Next, drag-and-drop the <strong>BinPackingPlacement</strong> and the <strong>RoundRobinPlacement</strong> policies in the <strong>Policies</strong> resources list of your HostsPool location.</p> |
| 229 | + |
| 230 | +<p>You must finally have this configuration:</p> |
| 231 | + |
| 232 | +<p><img src="../../../../images/2.1.0/yorc/hostspool-policy-resource.png" alt="Configure your hosts pool policies" /></p> |
| 233 | + |
| 234 | +<p>Now, your hosts pool location is configured with placement policies !</p> |
| 235 | + |
| 236 | +<h3 id="edit-application-topology-3">Edit application topology</h3> |
| 237 | + |
| 238 | +<p>You can apply a Round-robin placement policy to your application topology by using an abstract policy: the <strong>tosca.policies.Placement</strong>.</p> |
| 239 | + |
| 240 | +<p>This allows to deploy your application on Hosts pool, as well as on GCP, if another specific placement policy is implemented for GCP too.</p> |
| 241 | + |
| 242 | +<p>Select your application and go to the <strong>Topology Editor</strong>. Click on the <img src="../../../../images/2.1.0/yorc/topology-policies-button.png" alt="policies button" height="52px" class="inline" /> button on the vertical blue bar on the left. Click on the <strong>+ Add policies</strong> button, search the abstract policy node <strong>Placement</strong> (tosca.policies.Placement) and drag-and-drop it on the policies list of your topology.</p> |
| 243 | + |
| 244 | +<p>Then you can select the <strong>Targets</strong> of the placement policy, i.e in this case, the node name of the compute on which will be applied the placement policy.</p> |
| 245 | + |
| 246 | +<p><img src="../../../../images/2.1.0/yorc/placement-abstract-topology-editor.png" alt="Add placement policy to your application topology" /></p> |
| 247 | + |
| 248 | +<h3 id="manage-current-deployment">Manage current deployment</h3> |
| 249 | + |
| 250 | +<p>Once you choose the <strong>hosts pool location</strong> for deploying your application, in case of multiple hostspool placement policies, you have to choose the one you want during the <strong>Policies Matching</strong> step.</p> |
| 251 | + |
| 252 | +<p><img src="../../../../images/2.1.0/yorc/hostspool-policies-matching.png" alt="Select your policy during policies matching step" /></p> |
| 253 | + |
| 254 | +<p>That’s it ! you can deploy your application: the Round-robin placement policy will be applied on the 2 instances of the Compute node.</p> |
| 255 | + |
198 | 256 | <a class="btn btn-primary pull-right" href="http://prose.io/#alien4cloud/alien4cloud.github.io/edit/sources/documentation/2.1.0/orchestrators/yorc/policies.markdown"><i class="fa fa-pencil-square-o"></i> Edit (pull request)</a>
|
199 | 257 | </div>
|
200 | 258 | </div>
|
|
0 commit comments