|
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>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> |
| 29 | + <p>Both monitoring policies (HTTP/TCP) and Affinity/Anti-Affinity OpenStack ServerGroup placement policies are natively available with Yorc Server.</p> |
36 | 30 |
|
37 | 31 | <p>Let’s see how we can apply these on apps:</p> |
38 | 32 |
|
39 | 33 | <ul> |
40 | 34 | <li><a href="#applying-a-server-group-anti-affinity-placement-policy-on-openstack">Server Group Anti-affinity placement policy on OpenStack</a></li> |
41 | 35 | <li><a href="#applying-tcp-monitoring-policy">TCP monitoring policy</a></li> |
42 | 36 | <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> |
44 | 37 | </ul> |
45 | 38 |
|
46 | 39 | <h2 id="applying-a-server-group-anti-affinity-placement-policy-on-openstack">Applying a Server Group Anti affinity placement policy on OpenStack</h2> |
@@ -202,57 +195,6 @@ <h3 id="edit-application-topology-2">Edit application topology</h3> |
202 | 195 |
|
203 | 196 | <p>The next step will be to fix this by a self-healing policy !</p> |
204 | 197 |
|
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 | | - |
256 | 198 | <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> |
257 | 199 | </div> |
258 | 200 | </div> |
|
0 commit comments